schema stringlengths 20 14.6k | query stringlengths 17 2.58k | question stringlengths 8 1.06k |
|---|---|---|
<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, SUM( `<col10>` ) FROM `<table0>` WHERE NOT `<col0>` IN ( SELECT `<col0>` FROM `<table3>` ) ORDER BY SUM( `<col10>` ) | For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday, and could you order from low to high by the sum department id? |
<table0>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] } <table1>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] } | SELECT T1.Name, T2.Revenue FROM `<table0>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T2.Revenue | For those records from the products and each product's manufacturer, find name and the sum of revenue , and group by attribute name, and visualize them by a bar chart, I want to sort Y-axis in asc order.
|
<table0>[table_70331] { <col0>[Tournament]:[text] <col1>[2008]:[text] <col2>[2010]:[text] <col3>[2011]:[text] <col4>[2012]:[text] <col5>[2013]:[text] } | SELECT "2012" FROM `<table0>` WHERE "2011" = 'qf' | Name the 2012 for 2011 being qf
|
<table0>[table_14219514_1] { <col0>[home__2nd_leg]:[VARCHAR] <col1>[home__1st_leg]:[VARCHAR] } | SELECT home__2nd_leg_ FROM `<table0>` WHERE home__1st_leg_ = "Talleres" | Who was in home (2nd leg) when Talleres was in home (1st leg) |
<table0>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>... | SELECT TagName FROM `<table27>` ORDER BY Count DESC LIMIT 10000 | Select Top 10000 TagName From Tags Order By Count Desc.
|
<table0>[suppliers] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[country]:[VARCHAR] } <table1>[products] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[organic]:[BOOLEAN] <col3>[weight]:[FLOAT] <col4>[supplier_id]:[INT] } | SELECT s.name, SUM( p.weight ) FROM `<table0>` s INNER JOIN products p ON s.id = p.supplier_id WHERE p.organic = 't' GROUP BY s.name ORDER BY SUM( p.weight ) DESC LIMIT 2; | Find the total weight of organic products supplied by the top 2 suppliers. |
<table0>[table_name_82] { <col0>[election]:[VARCHAR] } | SELECT 2 AS nd_party FROM `<table0>` WHERE `<col0>` = "1865" | What is 2nd Party, when Election is '1865'? |
<table0>[project] { <col0>[INT]:[name] <col1>[TEXT]:[location] <col2>[TEXT]:[energy_efficiency] <col3>[FLOAT]:[INSERT] } | SELECT name, energy_efficiency FROM `<table0>` WHERE location = 'Asia' ORDER BY energy_efficiency DESC LIMIT 5; | Which renewable energy projects in Asia have the highest energy efficiency ratings? |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN lab ON `<table0>`.hadm_id = lab.hadm_id WHERE `<table0>`.insurance = "Medicaid" AND lab.label = "Magnesium" | how many patients on medicaid insurance had a lab test for magnesium? |
<table0>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comment] } <table1>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table2>[Votes] { <col0>[number]:[PostId] <col1>[... | SELECT Id, PostTypeId, CreationDate, Tags FROM `<table10>` WHERE CreationDate LIKE '%2017%' AND NOT NULLIF( Tags, '' ) IS NULL | ID and Tag for 2017.
|
<table0>[table_18118221_1] { <col0>[annual_interchanges__millions__2011_12]:[VARCHAR] <col1>[annual_entry_exit__millions__2011_12]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "36.609" | How many annual interchanges in the millions occurred in 2011-12 when the number of annual entry/exits was 36.609 million?
|
<table0>[table_25983027_1] { <col0>[evapotranspiration__km_3__year]:[VARCHAR] <col1>[rainfall_by_volume__km_3__year]:[VARCHAR] } | SELECT evapotranspiration__km_3__year_ FROM `<table0>` WHERE rainfall_by_volume__km_3__year_ = "13.2" | In the region where the rainfall by volume (km 3 /year) was 13.2, what was the evapotranspiration (km 3 /year)? |
<table0>[people] { <col0>[People_ID]:[int] <col1>[Sex]:[text] <col2>[text]:[Date_of_Birth] <col3>[text]:[Height] <col4>[real]:[Weight] } <table1>[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... | SELECT Sex, AVG( Weight ) FROM `<table0>` GROUP BY `<col1>` ORDER BY `<col1>` DESC | Return a bar chart about the distribution of Sex and the average of Weight , and group by attribute Sex, could you sort by the x axis in descending?
|
<table0>[table_40829] { <col0>[Player]:[text] <col1>[Tries]:[real] <col2>[Goals]:[real] <col3>[Field]:[Goals] <col4>[real]:[Points] } | SELECT AVG( "Tries" ) FROM `<table0>` WHERE "Goals" < '0' | What is the average Tries with less than 0 goals?
|
<table0>[table_name_3] { <col0>[host_country___countries]:[VARCHAR] <col1>[year]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2007" | Who was the host country in 2007? |
<table0>[t_kc22] { <col0>[number]:[CHA_ITEM_LEV] <col1>[number]:[DATA_ID] <col2>[text]:[DIRE_TYPE] <col3>[number]:[DOSE_FORM] <col4>[text]:[DOSE_UNIT] <col5>[text]:[EACH_DOSAGE] <col6>[text]:[EXP_OCC_DATE] <col7>[time]:[FLX_MED_ORG_ID] <col8>[text]:[FXBZ] <col9>[number]:[HOSP_DOC_CD] <col10>[text]:[HOSP_DOC_NM] <col11>... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM `<table2>` JOIN t_kc22 ON `<table2>`.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE `<table2>`.PERSON_NM = '尤意远' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' | 患者尤意远以前的治疗方案查一下
|
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[... | SELECT COUNT( DISTINCT `<table1>`.subject_id ) FROM `<table1>` INNER JOIN lab ON `<table1>`.hadm_id = lab.hadm_id WHERE lab.itemid = "51466" AND lab.flag = "delta" | among patients with item id 51466, how many of them were tested by lab for abnormal delta? |
<table0>[table_16729930_18] { <col0>[tdp]:[VARCHAR] <col1>[release_price___usd]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE release_price___usd__ = "$72" | For a release price of $72, what is the TDP of the microprocessor?
|
<table0>[flight_leg] { <col0>[flight_id]:[int] <col1>[leg_number]:[int] <col2>[leg_flight]:[int] } <table1>[restriction] { <col0>[restriction_code]:[text] <col1>[advance_purchase]:[int] <col2>[stopovers]:[text] <col3>[saturday_stay_required]:[text] <col4>[minimum_stay]:[int] <col5>[maximum_stay]:[int] <col6>[applicati... | SELECT DISTINCT flight.flight_id FROM `<table7>` AS AIRPORT_SERVICE_0, `<table7>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ( CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND fare.round_trip_required = 'NO' AND flight_fare.fare_id = fare.... | show me the one way flights from ATLANTA to PITTSBURGH |
<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 `<table2>`.subject_id ) FROM `<table2>` INNER JOIN prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE `<table2>`.age < "83" AND prescriptions.formulary_drug_cd = "NTGBASE" | what is the number of patients whose age is less than 83 and drug code is ntgbase?
|
<table0>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe] <col7>[text]:[Views] <col8>[number]:[UpVotes] <col9>[number]:[DownVotes] <col10>[number]:[ProfileImageUrl] <col11>... | SELECT q.Id AS "post_link" FROM `<table13>` AS a INNER JOIN `<table13>` AS q ON q.Id = a.ParentId WHERE a.OwnerUserId = '##UserID##' AND ( SELECT MAX( p.Score ) FROM `<table13>` AS p WHERE p.ParentId = q.Id AND p.Id != a.Id ) < a.Score ORDER BY q.ViewCount DESC | Questions with No accepted answer where I have the highest score. |
<table0>[table_name_72] { <col0>[away_team]:[VARCHAR] <col1>[venue]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "windy hill" | What is the away team for the game at Windy Hill? |
<table0>[table_name_60] { <col0>[owner]:[VARCHAR] <col1>[seats]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 84 | Which owner has 84 seats? |
<table0>[Flight] { <col0>[destination]:[VARCHAR] } | SELECT destination, COUNT( * ) FROM `<table0>` GROUP BY `<col0>` | Show all destinations and the number of flights to each destination. |
<table0>[inputevents_cv] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] } <table1>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[e... | SELECT `<table5>`.label FROM `<table5>` WHERE `<table5>`.itemid IN ( SELECT `<table14>`.itemid FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table12>`.hadm_id FROM `<table12>` WHERE `<table12>`.subject_id = 70206 ) AND DATETIME( `<table14>`.charttime ) <= DATETIME( CURRENT_TIME( ), '-25 month' ) ORDER BY `<t... | what laboratory test was given to patient 70206 for the first time until 25 months ago? |
<table0>[table_203_296] { <col0>[number]:[country] <col1>[text]:[total] <col2>[gdp]:[nominal] <col3>[billion]:[text] <col4>[gdp]:[capita] <col5>[ppp]:[text] <col6>[gdp]:[growth] <col7>[n2007]:[2011] <col8>[number]:[hdi] } | SELECT "country" FROM `<table0>` WHERE "gdp growth,\n2007-2011\n( in % )" = 0.6 | which country is the only country to have 0.6 % in gdp growth ? |
<table0>[table_13183] { <col0>[text]:[text] <col1>[text]:[text] <col2>[text]:[text] <col3>[noon]:[text] <col4>[text]:[text] <col5>[text]:[text] <col6>[text]:[text] <col7>[text]:[text] } | SELECT "5:00 pm" FROM `<table0>` WHERE "8:00 am" = 'local programs' AND "7:30 am" = 'local programs' | What is on at 5pm when Local Programs are on at 7:30am and 8:00am? |
<table0>[airline] { <col0>[airline_code]:[varchar] <col1>[airline_name]:[text] <col2>[note]:[text] } <table1>[flight_fare] { <col0>[flight_id]:[int] <col1>[fare_id]:[int] } <table2>[class_of_service] { <col0>[booking_class]:[varchar] <col1>[rank]:[int] <col2>[class_description]:[text] } <table3>[fare] { <col0>[fare_... | SELECT DISTINCT flight.flight_id FROM `<table6>` AS AIRPORT_SERVICE_0, `<table6>` 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' ... | i'd like to know the earliest flight from BOSTON to SAN FRANCISCO |
<table0>[table_72569] { <col0>[Rank]:[real] <col1>[Country]:[text] <col2>[Overall]:[text] <col3>[Justice]:[text] <col4>[Health]:[text] <col5>[Education]:[text] <col6>[Economics]:[text] <col7>[Politics]:[text] } | SELECT "Country" FROM `<table0>` WHERE "Health" = '91.4' | what's the country with health being 91.4
|
<table0>[table_name_48] { <col0>[game]:[INTEGER] <col1>[record]:[VARCHAR] } | SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "32-12-3" | What is the lowest game for a record of 32-12-3? |
<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 COUNT( DISTINCT `<table6>`.uniquepid ) FROM `<table6>` WHERE `<table6>`.`<table6>`unitstayid IN ( SELECT `<table2>`.`<table6>`unitstayid FROM `<table2>` WHERE `<table2>`.`<table2>`name = 'sedative - propofol' AND DATETIME( `<table2>`.`<table2>`time ) >= DATETIME( CURRENT_TIME( ), '-4 year' ) ) | what is the number of patients having their sedative - propofol performed since 4 years ago? |
<table0>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4... | SELECT t3.culturesite FROM ( SELECT t2.culturesite, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table2>`.`<table2>`time FROM `<table2>` JOIN patient ON `<table2>`.patientunitstayid = patient.patientunitstayid WHERE `<table2>`.`<table2>`name = 'hypothermia' AND DATETIME( `<ta... | in this year, what are the top five most frequent microbiology tests given to patients within 2 months after receiving hypothermia?
|
<table0>[table_name_78] { <col0>[record]:[VARCHAR] <col1>[opponent]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "san francisco warriors" | What is Record, when Opponent is San Francisco Warriors? |
<table0>[table_57992] { <col0>[Player]:[text] <col1>[Car]:[real] <col2>[Yards]:[real] <col3>[Avg]:[real] <col4>[real]:[Long] } | SELECT MIN( "Yards" ) FROM `<table0>` WHERE "TD's" > '0' AND "Avg." = '2.9' | How many yards for the player with over 0 TDs and an average of 2.9?
|
<table0>[IoT_Devices] { <col0>[INT]:[device_type] <col1>[VARCHAR]:[255] <col2>[location]:[VARCHAR] <col3>[255]:[INSERT] } | SELECT COUNT( * ) FROM `<table0>` WHERE `<col2>` LIKE '%Italy Vineyard%'; | How many IoT devices are connected to vineyards in Italy? |
<table0>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[locations] { <col0>[LOCATION... | SELECT PHONE_NUMBER, `<col7>` FROM `<table3>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table0>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col4>` DESC | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the phone_number by a bar chart, list PHONE_NUMBER in desc order. |
<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 COUNT( DISTINCT `<table9>`.uniquepid ) FROM `<table9>` WHERE `<table9>`.`<table9>`unitstayid IN ( SELECT `<table7>`.`<table9>`unitstayid FROM `<table7>` WHERE `<table7>`.celllabel = 'volume ( ml )-calcium chloride ivpb premix 1 g' AND `<table7>`.cellpath LIKE '%input%' AND STRFTIME( '%y', `<table7>`.`<table7>`ti... | count the number of patients who have been on volume (ml)-calcium chloride ivpb premix 1 g intake since 2105.
|
<table0>[table_name_74] { } | SELECT 2004 FROM `<table0>` WHERE 2005 = "2r" AND 2006 = "1r" | What is 2004, when 2005 is '2R', and when 2006 is '1R |
<table0>[city] { <col0>[integer]:[city_name] } <table1>[games] { <col0>[integer]:[games_year] <col1>[integer]:[games_name] <col2>[text]:[season] } <table2>[games_city] { <col0>[games_id]:[integer] <col1>[city_id]:[integer] } <table3>[medal] { <col0>[integer]:[medal_name] } <table4>[noc_region] { <col0>[integer]:[no... | SELECT T2.city_name FROM `<table2>` AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id WHERE T3.games_name IN ( '1976 Summer', '1976 Winter' ) | In which cities were the 1976 winter and summer games held? |
<table0>[diagnoses] { <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>` WHERE `<table1>`.gender = "M" AND `<table1>`.ethnicity = "BLACK/HAITIAN" | how many number of male patients are with black/haitian ethnicity? |
<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>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal... | SELECT HIRE_DATE, `<col8>` FROM `<table6>` WHERE `<col1>` LIKE '%D%' OR `<col1>` LIKE '%S%' ORDER BY `<col5>` DESC | For all employees who have the letters D or S in their first name, show me about the change of commission_pct over hire_date in a line chart, I want to sort HIRE_DATE in desc order.
|
<table0>[Grants] { <col0>[GrantID]:[int] <col1>[GrantSize]:[decimal] } | SELECT GrantSize, COUNT( `<col0>` ) AS GrantCount FROM `<table0>` GROUP BY GrantSize; | What is the distribution of grants by size? |
<table0>[table_59464] { <col0>[Year]:[text] <col1>[Champion]:[text] <col2>[Runner]:[text] <col3>[Score]:[text] } | SELECT "Champion" FROM `<table0>` WHERE "Name" = 'philips open' AND "Runner-up" = 'javier sánchez' | Who was the champion of the Philips Open with a runner-up of Javier S nchez?
|
<table0>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_... | SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE `<table4>`.age < "61" AND lab."CATEGORY" = "Blood Gas" | provide the number of patients whose age is less than 61 and lab test category is blood gas?
|
<table0>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] <col6>[JOB_ID]:[varchar] <col7>[SALARY]:[decimal] <col8>[COMMISSION_PCT]:[decimal] <col9>[MANAGER_ID]:[decimal] <col10>[DEPARTMENT_... | SELECT JOB_TITLE, COUNT( JOB_TITLE ) FROM `<table0>` AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE | Compare the total number of different job titles for all those jobs in department 80 using a bar chart. |
<table0>[table_name_49] { <col0>[tournament]:[VARCHAR] <col1>[opponent_in_the_final]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "andre agassi" | What is Tournament, when Opponent In The Final is "Andre Agassi"? |
<table0>[route] { <col0>[train_id]:[int] <col1>[station_id]:[int] } <table1>[train] { <col0>[int]:[train_number] <col1>[int]:[name] <col2>[text]:[origin] <col3>[text]:[destination] <col4>[text]:[time] <col5>[text]:[interval] } <table2>[station] { <col0>[int]:[network_name] <col1>[text]:[services] <col2>[text]:[local_... | SELECT origin, COUNT( * ) FROM `<table1>` GROUP BY origin ORDER BY COUNT( * ) DESC | Find the number of trains starting from each origin Plot them as bar chart, I want to rank in descending by the the total number .
|
<table0>[table_name_35] { <col0>[report]:[VARCHAR] <col1>[date]:[VARCHAR] <col2>[away_team]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "7 february" AND `<col2>` = "new zealand breakers" | Name the Report of 7 february with an Away team of new zealand breakers?
|
<table0>[table_name_5] { <col0>[date]:[VARCHAR] <col1>[visitor]:[VARCHAR] <col2>[record]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "new england whalers" AND `<col2>` = "9–9–1" | When has a Visitor of new england whalers, and a Record of 9–9–1? Question 2 |
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3... | SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN procedures ON `<table2>`.hadm_id = procedures.hadm_id WHERE `<table2>`.admission_location = "CLINIC REFERRAL/PREMATURE" AND procedures.icd9_code = "3891" | provide me the number of office admitted patients who have procedure icd9 code 3891.
|
<table0>[table_22951646_1] { <col0>[premiere]:[VARCHAR] <col1>[number_of_episodes]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 8 | Name the premiere for 8 episodes |
<table0>[Visitors] { <col0>[Tourist_ID]:[INTEGER] <col1>[Tourist_Details]:[VARCHAR] } <table1>[Ref_Hotel_Star_Ratings] { <col0>[star_rating_code]:[CHAR] <col1>[star_rating_description]:[VARCHAR] } <table2>[Hotels] { <col0>[hotel_id]:[INTEGER] <col1>[star_rating_code]:[CHAR] <col2>[pets_allowed_yn]:[CHAR] <col3>[price... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM `<table3>` AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID | Give me a histogram for what are the names and ids of the tourist attractions that are visited at most once?, and rank in asc by the y-axis.
|
<table0>[table_1557974_1] { <col0>[birthplace]:[VARCHAR] <col1>[debut]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2002-7" | Where were the wrestlers born who debuted in 2002-7?
|
<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, COUNT( `<col5>` ) FROM `<table0>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40 ORDER BY COUNT( `<col5>` ) 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, give me the comparison about the amount of hire_date over the hire_date bin hire_date by time, and show in descending by the Y.
|
<table0>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate] <col3>[time]:[OwnerUserId] <col4>[number]:[AutoRenameCount] <col5>[number]:[LastAutoRename] <col6>[time]:[Score] <col7>[number]:[ApprovedByUserId] <col8>[number]:[ApprovalDate] } <table1>[CloseAsOffTopicReas... | SELECT YEAR( CreationDate ) AS CreationDateYear, COUNT( * ) AS PostsThisYear FROM dbo.Posts WHERE OwnerUserId = 22656 GROUP BY YEAR( CreationDate ) ORDER BY YEAR( CreationDate ) | ORDER BY - most recent Posts by CreationDate. |
<table0>[table_name_53] { <col0>[opponent]:[VARCHAR] <col1>[date]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "august 30" | Who did the Jays play on August 30? |
<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 WHERE `<table1>`.admityear < "2187" AND diagnoses.short_title = "Other lung disease NEC" | provide the number of patients whose admission year is less than 2187 and diagnoses short title is other lung disease nec? |
<table0>[Purchases] { <col0>[PurchaseID]:[INT] <col1>[CustomerID]:[INT] <col2>[Brand]:[VARCHAR] <col3>[PurchaseDate]:[DATE] } | SELECT Brand, COUNT( DISTINCT `<col1>` ) as UniqueCustomers FROM `<table0>` WHERE `<col3>` >= '2021-01-01' GROUP BY Brand; | How many unique customers have purchased from each brand in the last year? |
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5... | SELECT COUNT( DISTINCT t2.uniquepid ) FROM ( SELECT t1.uniquepid, t1.`<table7>`time, t1.`<table9>`healthsystemstayid FROM ( SELECT `<table9>`.uniquepid, `<table7>`.`<table7>`time, `<table9>`.`<table9>`healthsystemstayid FROM `<table7>` JOIN `<table9>` ON `<table7>`.`<table9>`unitstayid = `<table9>`.`<table9>`unitstayid... | count the number of people that died after being diagnosed with hemorrhage in the same hospital encounter until 1 year ago. |
<table0>[ethical_manufacturing] { <col0>[INT]:[AUTO_INCREMENT] <col1>[company_name]:[VARCHAR] <col2>[location]:[VARCHAR] <col3>[ethical_certification]:[VARCHAR] <col4>[PRIMARY]:[KEY] } | SELECT * FROM ethical_manufacturing; | Show all records from the 'ethical_manufacturing' table |
<table0>[Museums] { <col0>[Museum_ID]:[INTEGER] <col1>[Museum_Details]:[VARCHAR] } <table1>[Shops] { <col0>[Shop_ID]:[INTEGER] <col1>[Shop_Details]:[VARCHAR] } <table2>[Staff] { <col0>[Staff_ID]:[INTEGER] <col1>[Tourist_Attraction_ID]:[INTEGER] <col2>[VARCHAR]:[Other_Details] <col3>[VARCHAR]:[255] } <table3>[Visits]... | SELECT T1.Name, T1.Tourist_Attraction_ID FROM `<table12>` AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID | Show the names and ids of tourist attractions that are visited at most once by a bar chart, list by the Y-axis in asc please.
|
<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 `<table5>` AS AIRPORT_SERVICE_0, `<table5>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ( CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CLEVELAND' AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day... | flights from KANSAS CITY to CLEVELAND on wednesday
|
<table0>[table_28686] { <col0>[series]:[real] <col1>[season]:[real] <col2>[Title]:[text] <col3>[Directed]:[text] <col4>[Written]:[text] <col5>[Original]:[air] <col6>[date]:[text] <col7>[Production]:[code] <col8>[real]:[viewers] <col9>[million]:[text] } | SELECT COUNT( "Production code" ) FROM `<table0>` WHERE "Title" = 'High Top Fade-Out' | What is the code of production in the chapter 'high top fade-out
|
<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 `<table6>`.drugstarttime 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 = '006-47576' ) ) AND `<table6>`.... | what was patient 006-47576's first prescribed time for 37.5 g tube : glucose 40 % po gel during this month?
|
<table0>[table_13566548_1] { <col0>[autonomous_community]:[VARCHAR] <col1>[wind_power]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 1042 | What is the community with a wind power of 1042? |
<table0>[table_203_469] { <col0>[number]:[year] <col1>[text]:[round] <col2>[text]:[position] <col3>[number]:[matches] <col4>[number]:[wins] <col5>[number]:[draws] <col6>[number]:[losses] <col7>[number]:[number] } | SELECT "year" FROM `<table0>` WHERE "year" IN ( 1998, 2002 ) ORDER BY "matches" DESC LIMIT 1 | which year had the most matches , 1998 or 2002 ? |
<table0>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[Votes] { <col0>[number]:[PostId] <col1>[number]:[VoteTypeId] <col2>[number]:[UserId] <col3>[number]:[CreationDate] <col4>[time]:[BountyAmount] } <table2>[VoteTypes] { <col0>[number]:[text] } <table3>[Posts] { <col0>[number]:[Pos... | SELECT PostId AS "post_link", CreationDate, `<table27>`TypeId AS "type", CASE WHEN `<table27>`TypeId = 35 THEN 'Away' WHEN `<table27>`TypeId = 36 THEN 'Here' END AS migrated, `<col6>` FROM `<table27>` WHERE PostId = '##postid:int?36025884##' | Migration notes in schema at Data.SE. http://meta.stackexchange.com/questions/280576/migration-notes-in-schema-at-data-se
|
<table0>[charging_stations] { <col0>[country]:[VARCHAR] <col1>[num_stations]:[INT] } | SELECT country, `<col1>` FROM `<table0>` WHERE `<col0>` IN ( 'Germany', 'France', 'Spain' ); | How many electric vehicle charging stations are there in Germany, France, and Spain? |
<table0>[table_29701] { <col0>[Season]:[real] <col1>[Series]:[text] <col2>[Team]:[text] <col3>[Races]:[real] <col4>[Wins]:[real] <col5>[Poles]:[real] <col6>[Laps]:[real] <col7>[Podiums]:[real] <col8>[Points]:[text] <col9>[Position]:[text] } | SELECT "Wins" FROM `<table0>` WHERE "Position" = '7th' | What are the wins for the 7th position?
|
<table0>[semester] { <col0>[semester_id]:[int] } <table1>[course_tags_count] { <col0>[course_id]:[int] <col1>[clear_grading]:[int] <col2>[pop_quiz]:[int] <col3>[group_projects]:[int] <col4>[inspirational]:[int] <col5>[long_lectures]:[int] <col6>[extra_credit]:[int] <col7>[few_tests]:[int] <col8>[good_feedback]:[int] <... | SELECT COUNT( * ) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 427 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | 427 is in next term ? |
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culturetakentim... | SELECT COUNT( * ) FROM `<table4>` WHERE `<table4>`.`<table9>`unitstayid IN ( SELECT `<table9>`.`<table9>`unitstayid FROM `<table9>` WHERE `<table9>`.`<table9>`healthsystemstayid IN ( SELECT `<table9>`.`<table9>`healthsystemstayid FROM `<table9>` WHERE `<table9>`.uniquepid = '005-76912' ) ) AND `<table4>`.cellpath LIKE ... | count the number of times that patient 005-76912 had had an ns ivf intake on 08/02/this year. |
<table0>[offshore_wells] { <col0>[well_id]:[INT] <col1>[location]:[VARCHAR] <col2>[255]:[production_figures] <col3>[FLOAT]:[INSERT] } | SELECT AVG( production_figures ) FROM `<table0>` WHERE `<col1>` = 'Gulf of Mexico'; | What are the average production figures for offshore wells in the Gulf of Mexico? |
<table0>[table_name_28] { <col0>[rank]:[VARCHAR] <col1>[gold]:[VARCHAR] <col2>[bronze]:[VARCHAR] <col3>[silver]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col2>` < 17 AND `<col3>` > 1 AND `<col1>` < 1 | Tell me the rank for bronze less than 17 and gold less than 1
|
<table0>[t_kc24] { <col0>[MED_SAFE_PAY_ID]:[text] <col1>[OVERALL_CD_ORG]:[text] <col2>[OVERALL_CD_PERSON]:[text] <col3>[MED_CLINIC_ID]:[text] <col4>[REF_SLT_FLG]:[number] <col5>[CLINIC_SLT_DATE]:[time] <col6>[COMP_ID]:[text] <col7>[PERSON_ID]:[text] <col8>[FLX_MED_ORG_ID]:[text] <col9>[INSU_TYPE]:[text] <col10>[MED_AMO... | SELECT `<col7>` FROM `<table1>` WHERE `<col3>` = '53117897919' AND `<col5>` = '402418932-k' | 和我讲讲医疗就诊53117897919中药品402418932-k所属的三大目录类别各是什么?
|
<table0>[Countries] { <col0>[INT]:[name] <col1>[VARCHAR]:[INSERT] } <table1>[SmartCities] { <col0>[INT]:[country_id] <col1>[INT]:[initiative_count] <col2>[INT]:[INSERT] } | SELECT `<table0>`.name, SUM( SmartCities.initiative_count ) FROM `<table0>` INNER JOIN SmartCities ON `<table0>`.id = SmartCities.country_id GROUP BY `<table0>`.name; | How many Smart City initiatives were implemented in each country? |
<table0>[products] { <col0>[product_name]:[VARCHAR] <col1>[product_id]:[VARCHAR] } <table1>[customer_orders] { <col0>[order_id]:[VARCHAR] <col1>[customer_id]:[VARCHAR] } <table2>[order_items] { <col0>[order_id]:[VARCHAR] <col1>[product_id]:[VARCHAR] } | SELECT DISTINCT T3.product_name FROM `<table1>` AS T1 JOIN order_items AS T2 ON T1.order_id = T2.order_id JOIN products AS T3 ON T2.product_id = T3.product_id GROUP BY T3.product_id HAVING COUNT( DISTINCT T1.customer_id ) >= 2 | Find the names of products that were bought by at least two distinct customers. |
<table0>[table_name_36] { <col0>[drawn]:[INTEGER] <col1>[played]:[INTEGER] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` < 18 | Which Drawn is the highest one that has a Played smaller than 18? |
<table0>[Accommodations] { <col0>[INT]:[StudentId] <col1>[INT]:[Type] <col2>[VARCHAR]:[RequestDate] <col3>[DATE]:[Region] <col4>[VARCHAR]:[INSERT] } | SELECT MIN( COUNT( * ) ) FROM `<table0>` WHERE RequestDate BETWEEN '2022-01-01' AND '2022-12-31' GROUP BY EXTRACT( MONTH FROM RequestDate ); | What is the minimum number of disability accommodations requested per month in Europe in 2022? |
<table0>[IncidentTracking] { <col0>[INT]:[source] <col1>[VARCHAR]:[incident_count] <col2>[INT]:[timestamp] <col3>[DATETIME]:[INSERT] } | SELECT source, COUNT( DISTINCT incident_count ) as unique_incidents FROM `<table0>` WHERE timestamp >= DATE_SUB( NOW( ), INTERVAL 3 MONTH ) GROUP BY source ORDER BY unique_incidents DESC; | Which threat intelligence sources have reported the highest number of unique security incidents in the last quarter, according to our Incident Tracking database? |
<table0>[table_56233] { <col0>[Yard]:[text] <col1>[Location]:[City] <col2>[State]:[text] <col3>[1st]:[Ship] <col4>[Delivery]:[Date] <col5>[text]:[Ship] <col6>[Types]:[Delivered] <col7>[text]:[Total] <col8>[Number]:[Ways] <col9>[text]:[Total] <col10>[Vessels]:[Built] <col11>[USMC]:[text] } | SELECT "Ship `<col6>` Delivered" FROM `<table0>` WHERE "Location ( City, `<col2>` )" = 'panama city, florida' | what is the ship types delivered when the location is panama city, florida?
|
<table0>[threat_intelligence] { <col0>[report_id]:[INT] <col1>[report_date]:[DATE] <col2>[report_type]:[TEXT] } | SELECT YEAR( `<col1>` ) as Year, DATEPART( QUARTER, `<col1>` ) as Quarter, COUNT( * ) as Number_of_Reports FROM `<table0>` WHERE `<col1>` BETWEEN '2021-01-01' AND '2022-12-31' AND `<col2>` = 'Cyber' GROUP BY YEAR( `<col1>` ), DATEPART( QUARTER, `<col1>` ); | How many cyber threat intelligence reports were generated each quarter in 2021 and 2022? |
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[... | SELECT `<table1>`.dischtime, procedures.long_title FROM `<table1>` INNER JOIN procedures ON `<table1>`.hadm_id = procedures.hadm_id WHERE `<table1>`.name = "Richard Gundlach" | what is discharge time and procedure long title of subject name richard gundlach?
|
<table0>[rural_infrastructure] { <col0>[INT]:[name] <col1>[VARCHAR]:[budget] <col2>[INT]:[location] <col3>[VARCHAR]:[INSERT] } | SELECT MAX( budget ) FROM rural_infrastructure; | What is the maximum budget for a rural infrastructure project in 'rural_infrastructure' table? |
<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 prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE `<table3>`.ethnicity = "WHITE" AND prescriptions.drug = "NEO*IV*Gentamicin" | How many white patients are on the drug neo*iv*gentamicin? |
<table0>[user_interactions] { <col0>[user_id]:[INT] <col1>[interaction_type]:[VARCHAR] <col2>[user_age]:[INT] <col3>[user_gender]:[VARCHAR] <col4>[user_location]:[VARCHAR] } | SELECT user_age, user_gender, `<col4>` FROM `<table0>` WHERE `<col1>` = 'engaged_content' AND `<col0>` NOT IN ( SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 'clicked_ad' AND clicked_ads = 'fast fashion' ); | Determine the age, gender, and location of users who have engaged with content about climate change but have not clicked on any ads about fast fashion. |
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table2>[m... | SELECT t3.culturesite FROM ( SELECT t2.culturesite, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table1>`.`<table1>`time FROM `<table1>` JOIN patient ON `<table1>`.patientunitstayid = patient.patientunitstayid WHERE `<table1>`.`<table1>`name = 'infectious disease consultation... | until 2 years ago what are the four most frequent microbiological tests given to patients within 2 months after receiving infectious disease consultation? |
<table0>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table1>[d_icd_procedures] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table2>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_i... | SELECT SUM( `<table12>`.value ) FROM `<table12>` WHERE `<table12>`.icustay_id IN ( SELECT `<table7>`.icustay_id FROM `<table7>` WHERE `<table7>`.hadm_id IN ( SELECT `<table11>`.hadm_id FROM `<table11>` WHERE `<table11>`.subject_id = 18316 ) ) AND STRFTIME( '%y-%m-%d', `<table12>`.charttime ) = '2103-11-16' | tell me the total amount of patient 18316's output on 11/16/2103.
|
<table0>[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] <col6>[building_manager]:[VARCHAR] <col7>[building_phone]:[VARCHAR] } <table1>[Apartments] { ... | SELECT booking_end_date, COUNT( `<col5>` ) FROM `<table5>` AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT( `<col4>` ) DESC | What is the number of booking end dates of the apartments with type code 'Duplex' in each year? Return a bar chart, and could you order y axis from high to low order? |
<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 prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE `<table3>`.admission_type = "URGENT" AND prescriptions.formulary_drug_cd = "PHEN100IVPB" | provide the number of patients whose admission type is urgent and drug code is phen100ivpb?
|
<table0>[table_14345690_2] { <col0>[finished]:[VARCHAR] <col1>[celebrity]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Tara Palmer-Tomkinson" | What position did Tara Palmer-Tomkinson finish? |
<table0>[table_name_14] { <col0>[date]:[VARCHAR] <col1>[home_team]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "south melbourne" | What was the date when South Melbourne was the home team? |
<table0>[co2_emissions] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[chemical_name] <col2>[VARCHAR]:[255] } | SELECT chemical_name, `<table0>`, RANK( ) OVER( ORDER BY `<table0>` DESC ) as co2_rank FROM `<table0>` WHERE date >= DATEADD( year, -1, GETDATE( ) ); | What is the CO2 emissions rank for each chemical in the past year? |
<table0>[table_204_699] { <col0>[number]:[district] <col1>[text]:[name] <col2>[text]:[party] <col3>[text]:[residence] <col4>[text]:[served] } | SELECT COUNT( * ) FROM `<table0>` GROUP BY "district" | how many members does each district have ? |
<table0>[table_204_10] { <col0>[number]:[ecclesiastical] <col1>[jurisdictions]:[text] <col2>[latin]:[name] <col3>[text]:[type] <col4>[text]:[rite] <col5>[text]:[ecclesiastical] <col6>[province]:[text] <col7>[established]:[text] <col8>[area]:[km2] } | SELECT "latin name" FROM `<table0>` WHERE "established" < 1900 | which was the only diocese established before 1900 ? |
<table0>[swimmer] { <col0>[int]:[name] <col1>[text]:[Nationality] <col2>[text]:[meter_100] <col3>[real]:[meter_200] <col4>[text]:[meter_300] <col5>[text]:[meter_400] <col6>[text]:[meter_500] <col7>[text]:[meter_600] <col8>[text]:[meter_700] <col9>[text]:[Time] } <table1>[stadium] { <col0>[int]:[name] <col1>[text]:[Cap... | SELECT ID, meter_100 FROM `<table0>` | Show me about the correlation between ID and meter_100 in a scatter chart.
|
<table0>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col4>[age]:[text] <col5>[ethnicity]:[text] <col6>[hospitalid]:[number] <col7>[wardid]:[number] <col8>[admissionheight]:[number] <col9>[admissionweight]:[number] <col10>[disch... | SELECT t3.drugname FROM ( SELECT t2.drugname, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT patient.uniquepid, `<table2>`.`<table2>`time, patient.patienthealthsystemstayid FROM `<table2>` JOIN patient ON `<table2>`.patientunitstayid = patient.patientunitstayid WHERE `<table2>`.`<table2>`name = 'dr... | what was the five most frequent drugs that were prescribed in the same hospital visit to the drug overdose- general male patient of age 60 or above after they had been diagnosed with drug overdose- general since 2 years ago? |
<table0>[marine_protected_areas] { <col0>[area_name]:[VARCHAR] <col1>[depth]:[FLOAT] } | SELECT AVG( depth ) FROM marine_protected_areas; | What is the average depth of all marine protected areas?' |
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN lab ON `<table4>`.hadm_id = lab.hadm_id WHERE lab.itemid = "51200" AND lab.flag = "delta" | count the number of patients whose item id is 51200 and lab test abnormal status is delta?
|
<table0>[users] { <col0>[INT]:[username] } <table1>[games] { <col0>[INT]:[title] } <table2>[gaming] { <col0>[user_games]:[user_id] <col1>[INT]:[game_id] <col2>[INT]:[play_date] } | SELECT `<table0>`.username, COUNT( * ) AS games_played FROM `<table0>` JOIN gaming.user_games ON `<table0>`.id = gaming.user_games.user_id GROUP BY `<table0>`.username; | What's the number of games played by each user in the 'gaming' schema? |
<table0>[table_name_85] { <col0>[game]:[VARCHAR] <col1>[year]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 2005 | What game was in 2005? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.