schema stringlengths 20 14.6k | query stringlengths 17 2.58k | question stringlengths 8 1.06k |
|---|---|---|
<table0>[clothing_production] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[country] <col2>[VARCHAR]:[item_type] <col3>[VARCHAR]:[production_cost] <col4>[FLOAT]:[INSERT] } | SELECT AVG( production_cost ) FROM `<table0>` WHERE country IN ( 'United States', 'China' ); | What is the average production cost of clothing items manufactured in the United States and China? |
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[ti... | SELECT `<table9>`.hospitaladmittime FROM `<table9>` WHERE `<table9>`.uniquepid = '029-16431' AND DATETIME( `<table9>`.hospitaladmittime, 'start of year' ) = DATETIME( CURRENT_TIME( ), 'start of year', '-0 year' ) ORDER BY `<table9>`.hospitaladmittime DESC LIMIT 1 | when did patient 029-16431 come this year for the last time to the hospital?
|
<table0>[city] { <col0>[city_code]:[varchar] <col1>[city_name]:[varchar] <col2>[state_code]:[varchar] <col3>[country_name]:[varchar] <col4>[time_zone_code]:[varchar] } <table1>[date_day] { <col0>[month_number]:[int] <col1>[day_number]:[int] <col2>[year]:[int] <col3>[day_name]:[varchar] } <table2>[restriction] { <col0... | SELECT DISTINCT flight.flight_id FROM `<table10>` AS AIRPORT_SERVICE_0, `<table10>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ( CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' A... | what is the latest flight leaving WASHINGTON for DENVER |
<table0>[users] { <col0>[INT]:[country] <col1>[VARCHAR]:[255] } <table1>[posts] { <col0>[INT]:[user_id] <col1>[INT]:[likes] <col2>[INT]:[hashtags] <col3>[TEXT]:[post_date] } <table2>[likes] { <col0>[INT]:[user_id] <col1>[INT]:[post_id] <col2>[INT]:[like_date] } | SELECT COUNT( DISTINCT user_id ) FROM `<table2>` INNER JOIN posts ON `<table2>`.post_id = posts.id INNER JOIN users ON posts.user_id = users.id WHERE users.country = 'Russia' AND hashtags LIKE '%#movies%' AND post_date >= DATE( NOW( ) ) - INTERVAL 1 WEEK; | What is the total number of unique users who liked posts containing the hashtag #movies, by users from Russia, in the last week? |
<table0>[table_27611593_5] { <col0>[opponents]:[VARCHAR] <col1>[partner]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Vania King" | Who were Petrova's opponents with Vania King? |
<table0>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table1>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <tab... | SELECT FIRST_NAME, `<col0>` FROM `<table5>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table0>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col1>` | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and employee_id , list x-axis in asc order. |
<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>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number]... | SELECT COUNT( * ) > 0 FROM `<table11>` WHERE `<table11>`.icustay_id IN ( SELECT `<table2>`.icustay_id FROM `<table2>` WHERE `<table2>`.hadm_id IN ( SELECT `<table16>`.hadm_id FROM `<table16>` WHERE `<table16>`.subject_id = 3911 ) ) AND `<table11>`.itemid IN ( SELECT `<table9>`.itemid FROM `<table9>` WHERE `<table9>`.la... | is it patient 3911's arterial bp [systolic] ever less than 149.0 since 728 days ago? |
<table0>[jobs] { <col0>[job_id]:[int] <col1>[job_title]:[varchar] <col2>[description]:[varchar] <col3>[requirement]:[varchar] <col4>[city]:[varchar] <col5>[state]:[varchar] <col6>[country]:[varchar] <col7>[zip]:[int] } <table1>[course_prerequisite] { <col0>[pre_course_id]:[int] <col1>[course_id]:[int] } <table2>[prog... | SELECT DISTINCT `<table12>`.name FROM `<table12>` INNER JOIN offering_`<table12>` ON offering_`<table12>`.`<table12>`_id = `<table12>`.`<table12>`_id INNER JOIN course_offering ON offering_`<table12>`.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN ... | Next semester , who is teaching PAT 451 ?
|
<table0>[table_16577990_1] { <col0>[tree_species]:[VARCHAR] <col1>[central_forest_reserve]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Kitechura" | How many tree species are in the kitechura reserve?
|
<table0>[production] { <col0>[country]:[VARCHAR] <col1>[255]:[REE] <col2>[VARCHAR]:[255] <col3>[INT]:[year] <col4>[INT]:[INSERT] } | UPDATE production SET amount = 3000 WHERE country = 'United States' AND REE = 'Praseodymium' AND year = 2021; | Update the production amount for Praseodymium in the United States in 2021 to 3000 tons. |
<table0>[table_203_137] { <col0>[number]:[title] <col1>[text]:[album] <col2>[details]:[text] <col3>[peak]:[chart] <col4>[positions]:[nus] <col5>[number]:[peak] <col6>[chart]:[positions] <col7>[nus]:[number] <col8>[certifications]:[text] } | SELECT COUNT( "title" ) FROM `<table0>` WHERE "peak `<col6>` positions\nus" <= 50 OR "peak `<col6>` positions\nus r&b" <= 50 | how many albums had a higher position on either chart than 50 ? |
<table0>[procedures] { <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 `<table2>`.age FROM `<table2>` WHERE `<table2>`.name = "Jerry Deberry" | what is age of subject name jerry deberry?
|
<table0>[table_4656] { <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 "Away team" FROM `<table0>` WHERE "Home `<col2>` score" = '7.11 ( 53 )' | What was the away team when the home team scored 7.11 (53)?
|
<table0>[regulatory_frameworks] { <col0>[INT]:[country] <col1>[VARCHAR]:[penalty] <col2>[DECIMAL]:[INSERT] } | DELETE FROM `<table0>` | Delete all records with a penalty higher than 100 from regulatory_frameworks |
<table0>[AircraftManufacturers] { <col0>[INT]:[VARCHAR] <col1>[Series]:[VARCHAR] } | SELECT COUNT( * ) FROM `<table0>` WHERE Name = 'Boeing' AND `<col1>` = '787 Dreamliner'; | What is the total number of aircraft manufactured by Boeing in the 'Dreamliner' series? |
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>... | SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN lab ON `<table1>`.hadm_id = lab.hadm_id WHERE `<table1>`.days_stay > "10" AND lab.fluid = "Other Body Fluid" | count the number of patients whose days of hospital stay is greater than 10 and lab test fluid is other body fluid? |
<table0>[graduate_students] { <col0>[INT]:[department] <col1>[VARCHAR]:[255] <col2>[num_publications]:[INT] } | SELECT department, AVG( `<col2>` ) as avg_publications FROM `<table0>` GROUP BY department; | What is the average number of publications per graduate student by department? |
<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 1 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table9>`.`<table9>`time ) ) FROM `<table9>` WHERE `<table9>`.`<table0>`unitstayid IN ( SELECT `<table0>`.`<table0>`unitstayid FROM `<table0>` WHERE `<table0>`.`<table0>`healthsystemstayid IN ( SELECT `<table0>`.`<table0>`healthsystemstayid FROM `<table0... | how many days have passed since last time patient 030-52327 was diagnosed with acute renal failure on this hospital encounter?
|
<table0>[brands] { <col0>[brand_id]:[INT] <col1>[name]:[VARCHAR] <col2>[255]:[follows_fair_labor] <col3>[BOOLEAN]:[INSERT] } <table1>[materials] { <col0>[material_id]:[INT] <col1>[name]:[VARCHAR] <col2>[255]:[is_eco_friendly] <col3>[BOOLEAN]:[cost] <col4>[DECIMAL]:[INSERT] } <table2>[brand_materials] { <col0>[brand_i... | SELECT AVG( bm.price ) FROM `<table2>` bm JOIN brands b ON bm.brand_id = b.brand_id JOIN materials m ON bm.material_id = m.material_id WHERE b.follows_fair_labor = TRUE AND m.is_eco_friendly = TRUE; | What is the average cost of eco-friendly materials for brands that follow fair labor practices? |
<table0>[table_27892955_1] { <col0>[title]:[VARCHAR] <col1>[us_viewers__million]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE us_viewers__million_ = "2.02" | What is the name of the episode that had 2.02 million u.s. viewers? |
<table0>[table_203_459] { <col0>[number]:[township] <col1>[text]:[fips] <col2>[number]:[population] <col3>[ncenter]:[text] <col4>[population]:[number] <col5>[population]:[ndensity] <col6>[km2]:[text] <col7>[land]:[area] <col8>[nkm2]:[text] <col9>[water]:[area] <col10>[nkm2]:[text] <col11>[water]:[text] <col12>[geograph... | SELECT "township" FROM `<table0>` WHERE "population" = 1660 | the town with at most 1660 total population
|
<table0>[movies] { <col0>[title]:[VARCHAR] <col1>[255]:[genre] <col2>[VARCHAR]:[budget] <col3>[INT]:[release_year] <col4>[INT]:[rating] <col5>[INT]:[INSERT] } | UPDATE movies SET rating = rating - 0.5 WHERE genre = 'Comedy'; | Update the ratings of all movies with a genre of 'Comedy' to be 0.5 points lower |
<table0>[table_name_20] { <col0>[home_team]:[VARCHAR] <col1>[venue]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "mcg" | What is the home team at the venue mcg? |
<table0>[table_53055] { <col0>[Date]:[text] <col1>[Visitor]:[text] <col2>[Score]:[text] <col3>[Home]:[text] <col4>[Decision]:[text] <col5>[Attendance]:[real] <col6>[Series]:[text] } | SELECT "Home" FROM `<table0>` WHERE "Date" = 'april 14' | Who was at home on april 14?
|
<table0>[table_5293] { <col0>[Season]:[text] <col1>[Champion]:[text] <col2>[Constructor]:[text] <col3>[Teams]:[Champion] <col4>[text]:[Secondary] <col5>[Class]:[text] <col6>[Nations]:[Cup] <col7>[text]:[Winter] <col8>[Series]:[Champion] } | SELECT "Teams' Champion" FROM `<table0>` WHERE "Winter `<col8>` Champion" = 'not held' AND "Secondary Class" = 'matt rao' | What team's champion has a secondary class of Matt Rao for a Winter Series Champion of Not Held?
|
<table0>[table_name_6] { <col0>[date]:[VARCHAR] <col1>[team]:[VARCHAR] <col2>[venue]:[VARCHAR] <col3>[win_draw_lose]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = "away" AND `<col3>` = "lost" AND `<col1>` = "accrington" | What was the date of the away game that they lost to Accrington? |
<table0>[table_name_85] { <col0>[bush_number]:[INTEGER] <col1>[kerry_number]:[VARCHAR] <col2>[others_percentage]:[VARCHAR] <col3>[others_number]:[VARCHAR] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col2>` = "1.7%" AND `<col3>` < 75 AND `<col1>` > 1 OFFSET 524 | What is the highest Bush#, when Others% is "1.7%", when Others# is less than 75, and when Kerry# is greater than 1,524? |
<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 `<table2>`.subject_id ) FROM `<table2>` WHERE `<table2>`.discharge_location = "LONG TERM CARE HOSPITAL" AND `<table2>`.diagnosis = "HEMOPYTSIS" | provide the number of patients whose discharge location is long term care hospital and primary disease is hemopytsis? |
<table0>[table_46096] { <col0>[Club]:[text] <col1>[Played]:[text] <col2>[Drawn]:[text] <col3>[Lost]:[text] <col4>[Points]:[text] <col5>[Points]:[text] <col6>[Tries]:[text] <col7>[Tries]:[text] <col8>[Try]:[bonus] <col9>[text]:[Losing] <col10>[bonus]:[text] <col11>[Points]:[text] } | SELECT "Points against" FROM `<table0>` WHERE "Tries for" = '41' | How many points against when 41 is the tries for?
|
<table0>[table_204_567] { <col0>[number]:[team] <col1>[text]:[location] <col2>[text]:[stadium] <col3>[text]:[capacity] <col4>[number]:[manager] <col5>[text]:[captain] <col6>[text]:[kit] <col7>[manufacturer]:[text] <col8>[shirt]:[sponsor] } | SELECT ( SELECT "capacity" FROM `<table0>` WHERE "stadium" = 'david farrington park' ) > ( SELECT "capacity" FROM `<table0>` WHERE "stadium" = 'porritt stadium' ) | does david farrington park have a larger capacity than porritt stadium ? |
<table0>[table_7913] { <col0>[Team]:[text] <col1>[Score]:[text] <col2>[Team]:[text] <col3>[1st]:[round] <col4>[text]:[2nd] <col5>[round]:[text] } | SELECT "1st round" FROM `<table0>` WHERE "Team 2" = 'olympique lyonnais ( d2 )' | what is the 1st round when team 2 is olympique lyonnais (d2)?
|
<table0>[table_10812938_5] { <col0>[pick__number]:[VARCHAR] <col1>[position]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "CB" | What's the pick number of the player whose position is CB? |
<table0>[country] { <col0>[country_id]:[integer] <col1>[country_iso_code]:[text] <col2>[country_name]:[text] } <table1>[department] { <col0>[department_id]:[integer] <col1>[department_name]:[text] } <table2>[gender] { <col0>[gender_id]:[integer] } <table3>[genre] { <col0>[genre_id]:[integer] <col1>[genre_name]:[text... | SELECT T1.company_name FROM `<table12>` AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id GROUP BY T1.company_id ORDER BY SUM( T3.revenue ) DESC LIMIT 1 | Which production company produced the movie that made the most money at the box office? |
<table0>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table1>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table2>[chartevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]... | SELECT COUNT( DISTINCT `<table3>`.subject_id ) FROM `<table3>` WHERE `<table3>`.hadm_id IN ( SELECT `<table11>`.hadm_id FROM `<table11>` WHERE `<table11>`.spec_type_desc = 'foreign body' AND DATETIME( `<table11>`.charttime ) <= DATETIME( CURRENT_TIME( ), '-4 year' ) ) | how many patients received a foreign body microbiology test until 4 years ago? |
<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>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_ti... | SELECT COUNT( * ) > 0 FROM `<table11>` WHERE `<table11>`.icustay_id IN ( SELECT `<table12>`.icustay_id FROM `<table12>` WHERE `<table12>`.hadm_id IN ( SELECT `<table13>`.hadm_id FROM `<table13>` WHERE `<table13>`.subject_id = 30826 ) ) AND `<table11>`.itemid IN ( SELECT `<table9>`.itemid FROM `<table9>` WHERE `<table9>... | had the arterial bp mean in patient 30826 ever been less than 88.0 since 03/27/2103?
|
<table0>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table1>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[t... | SELECT `<table5>`.sao2 FROM `<table5>` WHERE `<table5>`.`<table2>`unitstayid IN ( SELECT `<table2>`.`<table2>`unitstayid FROM `<table2>` WHERE `<table2>`.`<table2>`healthsystemstayid IN ( SELECT `<table2>`.`<table2>`healthsystemstayid FROM `<table2>` WHERE `<table2>`.uniquepid = '009-12221' ) ) AND NOT `<table5>`.sao2 ... | what was patient 009-12221's sao2 for the first time since 05/23/2101?
|
<table0>[tunnels] { <col0>[tunnel_name]:[TEXT] <col1>[tunnel_width]:[INT] <col2>[tunnel_state]:[TEXT] } | SELECT AVG( `<col1>` ) FROM `<table0>` WHERE `<col2>` = 'New Jersey'; | What is the average width of tunnels in New Jersey? |
<table0>[candidate] { <col0>[Candidate_ID]:[int] <col1>[People_ID]:[int] <col2>[Poll_Source]:[text] <col3>[Date]:[text] <col4>[Support_rate]:[real] <col5>[Consider_rate]:[real] <col6>[Oppose_rate]:[real] <col7>[Unsure_rate]:[real] } <table1>[people] { <col0>[People_ID]:[int] <col1>[Sex]:[text] <col2>[text]:[Date_of_Bi... | SELECT Date_of_Birth, Height FROM `<table1>` | Bar chart x axis date of birth y axis height |
<table0>[table_22883210_9] { <col0>[game]:[INTEGER] <col1>[team]:[VARCHAR] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Cleveland" | What is the highest game number where the team was Cleveland?
|
<table0>[table_27913160_3] { <col0>[pole_position]:[VARCHAR] <col1>[race]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Detroit" | Who had the pole position in Detroit?
|
<table0>[fare] { <col0>[fare_id]:[int] <col1>[from_airport]:[varchar] <col2>[to_airport]:[varchar] <col3>[fare_basis_code]:[text] <col4>[fare_airline]:[text] <col5>[restriction_code]:[text] <col6>[one_direction_cost]:[int] <col7>[round_trip_cost]:[int] <col8>[round_trip_required]:[varchar] } <table1>[time_zone] { <col... | SELECT DISTINCT flight.flight_id FROM `<table9>` AS AIRPORT_SERVICE_0, `<table9>` 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' A... | could you tell me about flights from PHILADELPHIA to DALLAS the flights should leave PHILADELPHIA in the morning |
<table0>[candidate] { <col0>[Candidate_ID]:[int] <col1>[People_ID]:[int] <col2>[Poll_Source]:[text] <col3>[Date]:[text] <col4>[Support_rate]:[real] <col5>[Consider_rate]:[real] <col6>[Oppose_rate]:[real] <col7>[Unsure_rate]:[real] } <table1>[people] { <col0>[People_ID]:[int] <col1>[Sex]:[text] <col2>[text]:[Date_of_Bi... | SELECT Name, Height FROM `<table1>` ORDER BY Height DESC | Return a bar chart about the distribution of Name and Height , and show Y-axis in descending order. |
<table0>[suppliers] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[country]:[VARCHAR] } <table1>[stores] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[city]:[VARCHAR] } <table2>[store_supplies] { <col0>[store_id]:[INT] <col1>[supplier_id]:[INT] } | SELECT s.name FROM `<table0>` s JOIN store_supplies ss ON s.id = ss.supplier_id JOIN stores st ON ss.store_id = st.id WHERE s.country = 'France' AND st.city = 'New York'; | List all suppliers from France that supply products to stores in New York. |
<table0>[table_name_91] { <col0>[label]:[VARCHAR] <col1>[format]:[VARCHAR] <col2>[region]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "cd" AND `<col2>` = "north america" | What is the label for the CD format in North America? |
<table0>[table_11000] { <col0>[1910]:[real] <col1>[1920]:[real] <col2>[1930]:[real] <col3>[1940]:[real] <col4>[1950]:[real] <col5>[1960]:[real] <col6>[1970]:[real] <col7>[1980]:[real] <col8>[1990]:[real] <col9>[2000]:[real] } | SELECT SUM( "1970" ) FROM `<table0>` WHERE "1960" < '4,228' AND "1920" < '106,021,568' AND "1980" > '949' | When 1960 is less than 4,228, 1920 is smaller than 106,021,568 and 1980 is larger than 949, what is the 1970 figure?
|
<table0>[PilotHours] { <col0>[PilotID]:[INT] <col1>[VARCHAR]:[100] <col2>[Service]:[VARCHAR] <col3>[TotalHours]:[FLOAT] } | SELECT SUM( `<col3>` ) FROM `<table0>` WHERE `<col2>` = 'Air Force'; | What is the total number of hours flown by all pilots in the Air Force? |
<table0>[table_67891] { <col0>[Club]:[text] <col1>[Played]:[text] <col2>[Drawn]:[text] <col3>[Lost]:[text] <col4>[Try]:[text] <col5>[Losing]:[text] } | SELECT "Try BP" FROM `<table0>` WHERE "Losing BP" = '4' AND "Club" = 'bargoed rfc' | What is the try BP when the losing BP is 4 and the club is Bargoed RFC?
|
<table0>[exists] { <col0>[shared_vehicles]:[INT] <col1>[city]:[VARCHAR] <col2>[vehicle_type]:[VARCHAR] <col3>[quantity]:[INT] <col4>[INSERT]:[shared_vehicles] <col5>[city]:[vehicle_type] <col6>[quantity]:[VALUES] <col7>[Los]:[Angeles] <col8>[electric_car]:[200] <col9>[Los]:[Angeles] <col10>[scooter]:[300] <col11>[New]:... | SELECT SUM( quantity ) FROM shared_vehicles WHERE city = 'Los Angeles'; | What is the total number of shared vehicles in Los Angeles? |
<table0>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[et... | SELECT SUM( `<table6>`.cellvaluenumeric ) FROM `<table6>` WHERE `<table6>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '022-78423' ) ) AND `... | tell me the total amount of propofol that patient 022-78423 has taken since 11/29/2104? |
<table0>[table_name_18] { <col0>[the_year]:[INTEGER] <col1>[regular_season]:[VARCHAR] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "7th" | Which Year has a Regular Season of 7th? |
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar... | SELECT HIRE_DATE, AVG( `<col7>` ) FROM `<table4>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table5>` WHERE `<col9>` BETWEEN 100 AND 200 ) | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday.
|
<table0>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table2>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[nu... | SELECT `<table12>`.charttime FROM `<table12>` WHERE `<table12>`.hadm_id IN ( SELECT `<table2>`.hadm_id FROM `<table2>` WHERE `<table2>`.subject_id = 49654 ) AND DATETIME( `<table12>`.charttime, 'start of year' ) = DATETIME( CURRENT_TIME( ), 'start of year', '-0 year' ) AND STRFTIME( '%m', `<table12>`.charttime ) = '07'... | when did patient 49654 last have a microbiological test in 07/this year?
|
<table0>[Cuisines] { <col0>[CuisineID]:[INT] <col1>[CuisineType]:[VARCHAR] } <table1>[Meals] { <col0>[MealID]:[INT] <col1>[CuisineID]:[INT] <col2>[MealName]:[VARCHAR] <col3>[CalorieCount]:[INT] <col4>[INSERT]:[Cuisines] <col5>[CuisineID]:[CuisineType] <col6>[VALUES]:[American] <col7>[Italian]:[INSERT] } | SELECT CuisineType, SUM( CalorieCount ) as total_calories FROM `<table0>` C JOIN Meals M ON C.CuisineID = M.CuisineID GROUP BY CuisineType; | What is the total calorie count for each type of cuisine? |
<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>` WHERE `<table0>`.gender = "F" AND `<table0>`.ethnicity = "HISPANIC OR LATINO" | give me the number of patients whose gender is f and ethnicity is hispanic or latino?
|
<table0>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table1>[equipment_sequence] { <col0>[aircraft_code_sequence]:[varchar] <col1>[aircraft_code]:[varchar] } <table2>[ground_service] { <co... | SELECT DISTINCT flight.flight_id FROM `<table3>` AS AIRPORT_SERVICE_0, `<table3>` 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' ... | i would like to see the flights from BALTIMORE to PHILADELPHIA again
|
<table0>[table_46004] { <col0>[Position]:[real] <col1>[Played]:[real] <col2>[Points]:[real] <col3>[Wins]:[real] <col4>[Draws]:[real] <col5>[Losses]:[real] <col6>[Goals]:[real] <col7>[Goals]:[real] <col8>[Goal]:[Difference] } | SELECT AVG( "Played" ) FROM `<table0>` WHERE "Wins" < '11' AND "Goals for" > '42' AND "Points" > '22' AND "Losses" = '11' | What is the average number played that has fewer than 11 wins, more than 42 goals, more than 22 points, and 11 losses?
|
<table0>[wine] { <col0>[INTEGER]:[Grape] <col1>[TEXT]:[Winery] <col2>[TEXT]:[Appelation] <col3>[TEXT]:[State] <col4>[TEXT]:[TEXT] <col5>[Year]:[INTEGER] <col6>[Price]:[INTEGER] <col7>[Score]:[INTEGER] <col8>[Cases]:[INTEGER] <col9>[Drink]:[TEXT] } <table1>[appellations] { <col0>[INTEGER]:[Appelation] <col1>[TEXT]:[Cou... | SELECT Name, COUNT( Name ) FROM `<table1>` AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY COUNT( Name ) | What are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, could you sort the number of name from low to high order? |
<table0>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table1>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table2>[regions] { <col0>[REGION_ID]:[decimal] <col1>[... | SELECT FIRST_NAME, `<col0>` FROM `<table5>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table0>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col1>` | For those employees who do not work in departments with managers that have ids between 100 and 200, find first_name and employee_id , and visualize them by a bar chart, order from low to high by the bars. |
<table0>[Catalogs] { <col0>[catalog_id]:[INTEGER] <col1>[catalog_name]:[VARCHAR] <col2>[catalog_publisher]:[VARCHAR] <col3>[date_of_publication]:[DATETIME] <col4>[date_of_latest_revision]:[DATETIME] } <table1>[Attribute_Definitions] { <col0>[attribute_id]:[INTEGER] <col1>[attribute_name]:[VARCHAR] <col2>[attribute_dat... | SELECT catalog_entry_name, COUNT( `<col5>` ) FROM `<table4>` AS t1 JOIN `<table4>`_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY `<col5>` | What are the names of catalog entries with level number 8, and count them by a bar chart |
<table0>[research_papers] { <col0>[paper_id]:[INT] <col1>[title]:[VARCHAR] <col2>[publication_month]:[DATE] } | SELECT EXTRACT( MONTH FROM `<col2>` ) month, COUNT( * ) papers_per_month FROM `<table0>` GROUP BY month ORDER BY month; | Find the number of autonomous driving research papers published per month in the 'research_papers' table. |
<table0>[table_name_63] { <col0>[name]:[VARCHAR] <col1>[winning_drivers]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "tazio nuvolari" | What race was won by Tazio Nuvolari? |
<table0>[table_name_18] { <col0>[to_par]:[VARCHAR] <col1>[player]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "ben crenshaw" | Ben Crenshaw has what To par? |
<table0>[table_204_311] { <col0>[number]:[rank] <col1>[number]:[nation] <col2>[text]:[gold] <col3>[number]:[silver] <col4>[number]:[bronze] <col5>[number]:[total] } | SELECT COUNT( "nation" ) FROM `<table0>` WHERE "total" > 6 | how many teams won more than 6 medals total ? |
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[tim... | SELECT COUNT( * ) FROM `<table0>` WHERE `<table0>`.`<table3>`unitstayid IN ( SELECT `<table3>`.`<table3>`unitstayid FROM `<table3>` WHERE `<table3>`.`<table3>`healthsystemstayid IN ( SELECT `<table3>`.`<table3>`healthsystemstayid FROM `<table3>` WHERE `<table3>`.uniquepid = '031-15417' ) ) AND `<table0>`.culturesite = ... | was there a result of a microbiological test in patient 031-15417's urine, catheter specimen since 5 years ago?
|
<table0>[table_name_71] { <col0>[touchdowns]:[INTEGER] <col1>[field_goals]:[INTEGER] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` > 0 | Who had the most touchdowns with more than 0 Field goals?
|
<table0>[table_1342149_24] { <col0>[candidates]:[VARCHAR] <col1>[result]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Lost renomination Democratic loss" | Name the candidates for result of lost renomination democratic loss |
<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 `<table4>`.name, procedures.short_title FROM `<table4>` INNER JOIN procedures ON `<table4>`.hadm_id = procedures.hadm_id WHERE `<table4>`.subject_id = "29961" | what is subject name and procedure short title of subject id 29961?
|
<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>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table2>[transfers] { <col0>[row_id]:[number] <col... | SELECT SUM( `<table0>`.`<table0>` ) FROM `<table0>` WHERE `<table0>`.hadm_id IN ( SELECT `<table16>`.hadm_id FROM `<table16>` WHERE `<table16>`.subject_id = 5658 ) AND DATETIME( `<table0>`.chargetime, 'start of year' ) = DATETIME( CURRENT_TIME( ), 'start of year', '-0 year' ) | what is the total total hospital cost of patient 5658 in this year?
|
<table0>[university] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Founded]:[real] <col4>[Affiliation]:[text] <col5>[Enrollment]:[real] <col6>[Nickname]:[text] <col7>[Primary_conference]:[text] } <table1>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Nam... | SELECT School_ID, `<col4>` FROM `<table1>` | A scatter chart shows the correlation between School_ID and ACC_Percent . |
<table0>[table_64698] { <col0>[Player]:[text] <col1>[Matches]:[text] <col2>[Runs]:[text] <col3>[Balls]:[text] <col4>[Strike]:[Rate] <col5>[text]:[Average] <col6>[text]:[100s] } | SELECT "Matches" FROM `<table0>` WHERE "100s" = '2' | What matches is 2 the 100s?
|
<table0>[autonomous_buses] { <col0>[bus_id]:[INT] <col1>[route_id]:[INT] <col2>[trip_start_time]:[TIMESTAMP] <col3>[trip_end_time]:[TIMESTAMP] <col4>[incidents]:[INT] } | SELECT route_id, SUM( `<col4>` ) FROM `<table0>` WHERE city = 'Toronto' GROUP BY route_id; | List all autonomous bus routes and the number of incidents in Toronto for each route. |
<table0>[table_203_396] { <col0>[number]:[year] <col1>[number]:[domestic] <col2>[passengers]:[number] <col3>[international]:[passengers] <col4>[number]:[total] <col5>[passengers]:[number] <col6>[change]:[text] } | SELECT "year" FROM `<table0>` ORDER BY "change" LIMIT 1 | which year saw the highest drop in total passengers from the previous year ? |
<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 t1.`<table2>`name FROM ( SELECT `<table2>`.`<table2>`name, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM `<table2>` WHERE `<table2>`.`<table0>`unitstayid IN ( SELECT `<table0>`.`<table0>`unitstayid FROM `<table0>` WHERE `<table0>`.age BETWEEN 30 AND 39 ) AND STRFTIME( '%y', `<table2>`.`<table2>`time... | what were the top three most common diagnoses of patients aged 30s until 2102.
|
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadm... | SELECT `<table2>`.wardid FROM `<table2>` WHERE `<table2>`.`<table2>`healthsystemstayid IN ( SELECT `<table2>`.`<table2>`healthsystemstayid FROM `<table2>` WHERE `<table2>`.uniquepid = '030-44598' AND `<table2>`.hospitaldischargetime IS NULL ) ORDER BY `<table2>`.unitadmittime DESC LIMIT 1 | what was the last ward id that patient 030-44598 went in this hospital encounter?
|
<table0>[table_name_58] { <col0>[events]:[VARCHAR] <col1>[wins]:[VARCHAR] <col2>[top_5]:[VARCHAR] <col3>[cuts_made]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col2>` = 2 AND `<col3>` = 4 AND `<col1>` < 0 | How many events total is the Top-5 2, and 4 is the cuts made, and less than 0 wins? |
<table0>[table_20464] { <col0>[Rank]:[average] <col1>[real]:[Place] <col2>[text]:[Couple] <col3>[text]:[Perfect] <col4>[40s]:[real] <col5>[Total]:[real] <col6>[Number]:[dances] <col7>[real]:[Season] <col8>[real]:[Average] } | SELECT MAX( "Total" ) FROM `<table0>` WHERE "Average" = '28.5' | What is the maximum total in which the average is 28.5?
|
<table0>[table_name_62] { <col0>[name]:[VARCHAR] } | SELECT 2013 AS _club FROM `<table0>` WHERE `<col0>` = "ana grbac category:articles with hcards" | Name the 2013 club which has a Name of ana grbac category:articles with hcards? |
<table0>[Restaurants] { <col0>[RestaurantID]:[int] <col1>[RestaurantName]:[varchar] <col2>[255]:[INSERT] } <table1>[Inspections] { <col0>[InspectionID]:[int] <col1>[RestaurantID]:[int] <col2>[Violation]:[varchar] <col3>[255]:[INSERT] } | SELECT R.RestaurantName FROM `<table0>` R INNER JOIN Inspections I ON R.RestaurantID = I.RestaurantID WHERE I.Violation IS NOT NULL; | List all restaurants that had a food safety inspection violation |
<table0>[lollapalooza] { <col0>[year]:[INT] <col1>[revenue]:[FLOAT] } | SELECT `<col1>` FROM `<table0>` WHERE `<col0>` = 2018; | What was the revenue for the 2018 Lollapalooza festival? |
<table0>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table1>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number... | SELECT `<table1>`.`<table1>`time FROM `<table1>` WHERE `<table1>`.`<table7>`unitstayid IN ( SELECT `<table7>`.`<table7>`unitstayid FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `<table7>` WHERE `<table7>`.uniquepid = '006-66713' ) ) AND `<table1>`... | when was the last time until 1749 days ago that patient 006-66713 has had a p.o. intake?
|
<table0>[table_name_77] { <col0>[elevated]:[VARCHAR] <col1>[cardinalatial_title]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "priest of ss. xii apostoli" | What's listed for Elevatated that has Cardinalatial title of Priest of SS. XII Apostoli?
|
<table0>[table_70900] { <col0>[Rank]:[real] <col1>[Nation]:[text] <col2>[Gold]:[real] <col3>[Silver]:[real] <col4>[Bronze]:[real] <col5>[Total]:[real] } | SELECT MAX( "Bronze" ) FROM `<table0>` WHERE "Rank" > '5' AND "Nation" = 'chinese taipei' AND "Total" < '1' | Which is the highest bronze at Chinese Taipei when the rank was higher than 5 and total was smaller than 1?
|
<table0>[customers] { <col0>[customer_id]:[INT] <col1>[customer_name]:[VARCHAR] <col2>[ethical_supplier]:[BOOLEAN] } <table1>[purchases] { <col0>[purchase_id]:[INT] <col1>[customer_id]:[INT] <col2>[supplier_id]:[INT] } | SELECT COUNT( DISTINCT `<col1>` ) FROM ( SELECT `<col1>` FROM `<table1>` p JOIN customers c ON p.customer_id = c.customer_id WHERE c.ethical_supplier = TRUE INTERSECT SELECT `<col1>` FROM `<table1>` p JOIN customers c ON p.customer_id = c.customer_id WHERE c.ethical_supplier = FALSE ); | Find the number of unique customers who purchased products from both ethical and non-ethical suppliers. |
<table0>[table_204_130] { <col0>[number]:[number] <col1>[date]:[text] <col2>[venue]:[text] <col3>[opponent]:[text] <col4>[score]:[text] <col5>[result]:[text] <col6>[competition]:[text] } | SELECT "venue" FROM `<table0>` WHERE "date" < ( SELECT "date" FROM `<table0>` WHERE "venue" = 'ginasio chico neto, maringa' ) ORDER BY "date" DESC LIMIT 1 | what venue is previous to gin sio chico neto , maring ? |
<table0>[CountryRegion] { <col0>[CountryRegionCode]:[text] <col1>[text]:[ModifiedDate] } <table1>[Culture] { <col0>[CultureID]:[text] <col1>[text]:[ModifiedDate] } <table2>[Currency] { <col0>[CurrencyCode]:[text] <col1>[text]:[ModifiedDate] } <table3>[CountryRegionCurrency] { <col0>[CountryRegionCode]:[text] <col1>[... | SELECT `<table60>`ID FROM `<table60>` WHERE `<table60>`ID IN ( SELECT `<table60>`ID FROM `<table39>` WHERE `<col5>` = 'P' ) | What is the name of product purchased with transaction type P? |
<table0>[table_11677100_18] { <col0>[hometown]:[VARCHAR] <col1>[position]:[VARCHAR] <col2>[school]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Pitcher" AND `<col2>` = "Saint Joseph Regional High school" | What is the hometown of the pitcher who's school was Saint Joseph Regional High School? |
<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 MAX( `<table4>`.age ) FROM `<table4>` WHERE `<table4>`.marital_status = "MARRIED" AND `<table4>`.age >= "45" | calculate the maximum age of married patients who are aged 45 years or more.
|
<table0>[procedures_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table2... | SELECT t3.spec_type_desc FROM ( SELECT t2.spec_type_desc, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT admissions.subject_id, `<table0>`.charttime FROM `<table0>` JOIN admissions ON `<table0>`.hadm_id = admissions.hadm_id WHERE `<table0>`.icd9_code = ( SELECT `<table5>`.icd9_code FROM `<table5>` ... | what are the four most commonly given microbiological tests for patients who had previously received exc/dest hrt lesion open during the same month until 1 year ago?
|
<table0>[sustainable_forest] { <col0>[country]:[VARCHAR] <col1>[255]:[area] <col2>[INT]:[INSERT] } | SELECT country, SUM( area ) FROM sustainable_forest; | How many hectares of forest are managed sustainably in each country? |
<table0>[table_name_95] { <col0>[year]:[INTEGER] <col1>[state]:[VARCHAR] <col2>[name]:[VARCHAR] } | SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "orissa" AND `<col2>` = "prof. priyambada mohanty hejmadi" | What is the sum of the years when the winner was prof. priyambada mohanty hejmadi from orissa? |
<table0>[Images] { <col0>[image_id]:[INTEGER] <col1>[image_alt_text]:[VARCHAR] <col2>[image_name]:[VARCHAR] <col3>[image_url]:[VARCHAR] } <table1>[Document_Sections] { <col0>[section_id]:[INTEGER] <col1>[document_code]:[VARCHAR] <col2>[section_sequence]:[INTEGER] <col3>[section_code]:[VARCHAR] <col4>[section_title]:[V... | SELECT role_code, COUNT( * ) FROM `<table3>` GROUP BY `<col1>` ORDER BY COUNT( * ) DESC | What are the different role codes for users, and how many users have each Show bar chart, order by the the total number from high to low. |
<table0>[table_name_88] { } | SELECT SUM( 2000 ) FROM `<table0>` WHERE 1969 = 54.3 AND 1979 < 48.4 | What is the 2000 number when the 1969 is 54.3, and the 1979 is less than 48.4?
|
<table0>[party] { <col0>[Party_ID]:[int] <col1>[Year]:[real] <col2>[Party]:[text] <col3>[Governor]:[text] <col4>[Lieutenant_Governor]:[text] <col5>[Comptroller]:[text] <col6>[Attorney_General]:[text] <col7>[US_Senate]:[text] } <table1>[county] { <col0>[County_Id]:[int] <col1>[County_name]:[text] <col2>[Population]:[re... | SELECT Governor, COUNT( Governor ) FROM `<table2>` AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY Governor DESC | Find the number of the parties associated with the delegates from district 1 Who served as governors of the parties?, could you sort from high to low by the Governor? |
<table0>[table_7860] { <col0>[Position]:[real] <col1>[Club]:[text] <col2>[Played]:[real] <col3>[Points]:[real] <col4>[Wins]:[real] <col5>[Draws]:[real] <col6>[Losses]:[real] <col7>[Goals]:[real] <col8>[Goals]:[real] <col9>[Goal]:[Difference] } | SELECT MIN( "Draws" ) FROM `<table0>` WHERE "Club" = 'ud lérida' AND "Goals for" < '41' | What is the lowest amount of draws club ud l rida, which has less than 41 goals, has? |
<table0>[volunteers] { <col0>[INT]:[last_activity_date] <col1>[DATE]:[INSERT] } | DELETE FROM `<table0>` WHERE last_activity_date < ( CURRENT_DATE - INTERVAL '6 months' ); | Delete all volunteers who have not conducted any activities in the past 6 months. |
<table0>[table_204_964] { <col0>[number]:[team] <col1>[text]:[seasons] <col2>[number]:[games] <col3>[number]:[wins] <col4>[number]:[ties] <col5>[number]:[losses] <col6>[number]:[goals] <col7>[nfor]:[number] <col8>[goals]:[nagainst] <col9>[number]:[goal] <col10>[ndiff]:[number] <col11>[points]:[number] } | SELECT "losses" FROM `<table0>` WHERE "team" = 'st. louis blues' | how many losses do the st. louis blues have ? |
<table0>[csu_fees] { <col0>[campusfee]:[INTEGER] <col1>[YEAR]:[VARCHAR] } | SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 1996 | Find the average fee on a CSU campus in 1996 |
<table0>[table_name_17] { <col0>[number_of_seats]:[VARCHAR] <col1>[year]:[VARCHAR] <col2>[quantity]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "2001" AND `<col2>` > 4 | How many seats in 2001 with a quantity greater than 4? |
<table0>[table_name_60] { <col0>[silver]:[VARCHAR] <col1>[bronze]:[VARCHAR] <col2>[gold]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 6 AND `<col2>` > 3 | How many silvers for nations with over 3 golds and under 6 bronzes? |
<table0>[Categories] { <col0>[CategoryID]:[integer] <col1>[CategoryName]:[text] <col2>[Description]:[text] } <table1>[Customers] { <col0>[CustomerID]:[integer] <col1>[CustomerName]:[text] <col2>[ContactName]:[text] <col3>[Address]:[text] <col4>[City]:[text] <col5>[PostalCode]:[text] <col6>[Country]:[text] } <table2>[... | SELECT CAST( COUNT( CASE WHEN Discontinued = 1 THEN 1 ELSE NULL END ) AS REAL ) * 100 / COUNT( `<col0>` ) FROM `<table5>` | Find the percentage of discontinued products in Northwind's portfolio of products. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.