schema stringlengths 20 14.6k | query stringlengths 17 2.58k | question stringlengths 8 1.06k |
|---|---|---|
<table0>[addresses] { <col0>[address_id]:[number] <col1>[address_details]:[text] } <table1>[ref_document_types] { <col0>[document_type_code]:[text] <col1>[document_type_description]:[text] } <table2>[draft_copies] { <col0>[document_id]:[number] <col1>[draft_number]:[number] <col2>[copy_number]:[number] } <table3>[ci... | SELECT COUNT( * ) FROM `<table8>` JOIN documents ON documents.shipping_agent_code = `<table8>`.shipping_agent_code WHERE `<table8>`.shipping_agent_name = "USPS" | How many documents were shipped by USPS?
|
<table0>[table_203_176] { <col0>[number]:[name] <col1>[text]:[name] <col2>[text]:[caps] <col3>[number]:[goals] <col4>[number]:[cap] <col5>[text]:[opponent] <col6>[text]:[club] } | SELECT "full name" FROM `<table0>` WHERE "full name" IN ( 'lucimar ferreira da silva', 'adriano leite ribeiro' ) AND "opponent" = 'colombia' ORDER BY "goals" DESC LIMIT 1 | whose number of goals was greater against columbia , lucimar ferreira da silva or adriano leite ribeiro ? |
<table0>[table_203_212] { <col0>[number]:[number] <col1>[district]:[text] <col2>[land]:[area] <col3>[km2]:[number] <col4>[population]:[2010] <col5>[census]:[number] <col6>[density]:[persons] <col7>[km2]:[number] } | SELECT "land area ( `<col3>` )" FROM `<table0>` WHERE "district" = 'saint lucia' | what is the total land area of saint lucia -lrb- in square kilometers -rrb- ?
|
<table0>[green_building_materials] { <col0>[INT]:[building_id] <col1>[INT]:[material] <col2>[VARCHAR]:[255] <col3>[quantity]:[INT] } | SELECT building_id, material, quantity, RANK( ) OVER( PARTITION BY building_id ORDER BY `<col3>` DESC ) as high_quantity_material FROM `<table0>` WHERE building_id = 1003; | What are the materials and their quantities, ranked by quantity for building 1003? |
<table0>[table_13553701_1] { <col0>[mens_singles]:[VARCHAR] <col1>[womens_singles]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Wang Shixian" | Who is the mens singles and womens singlses is wang shixian? |
<table0>[missions] { <col0>[INT]:[name] <col1>[VARCHAR]:[255] <col2>[type]:[VARCHAR] <col3>[255]:[cost] <col4>[FLOAT]:[INSERT] } | SELECT SUM( cost ) FROM `<table0>` WHERE `<col2>` = 'Servicing' AND name LIKE '%Hubble%'; | What is the total cost of all Hubble Space Telescope servicing missions? |
<table0>[table_name_98] { <col0>[total_g]:[INTEGER] <col1>[c_apps]:[VARCHAR] <col2>[l_apps]:[VARCHAR] <col3>[player]:[VARCHAR] } | SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col2>` = 29 AND `<col3>` = "bartolo" AND `<col1>` > 5 | What is Bartolo's Total G when his L Apps is 29 and his C Apps are larger than 5?
|
<table0>[WarehouseTransfers] { <col0>[INT]:[source_warehouse_id] <col1>[INT]:[destination_warehouse_id] <col2>[INT]:[lead_time] <col3>[INT]:[INSERT] } <table1>[Warehouses] { <col0>[INT]:[name] <col1>[TEXT]:[city] <col2>[TEXT]:[state] <col3>[TEXT]:[INSERT] } | SELECT MIN( lead_time ) FROM `<table0>` JOIN Warehouses ON `<table0>`.source_warehouse_id = Warehouses.id WHERE Warehouses.name = 'Mumbai Warehouse'; | What is the minimum lead time for warehouse transfers from the Mumbai warehouse? |
<table0>[table_name_99] { <col0>[time]:[VARCHAR] <col1>[year]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "1984" | What was the winning time in 1984? |
<table0>[t_kc24] { <col0>[ACCOUNT_DASH_DATE]:[time] <col1>[ACCOUNT_DASH_FLG]:[number] <col2>[CASH_PAY]:[number] <col3>[CIVIL_SUBSIDY]:[number] <col4>[CKC102]:[number] <col5>[CLINIC_ID]:[text] <col6>[CLINIC_SLT_DATE]:[time] <col7>[COMP_ID]:[text] <col8>[COM_ACC_PAY]:[number] <col9>[COM_PAY]:[number] <col10>[DATA_ID]:[te... | SELECT `<table3>`.DIRE_TYPE FROM `<table3>` JOIN t_kc21_`<table3>` JOIN t_kc21 ON t_kc21_`<table3>`.MED_EXP_DET_ID = `<table3>`.MED_EXP_DET_ID AND t_kc21_`<table3>`.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '94037456658' AND `<table3>`.SOC_SRT_DIRE_NM = '天冬酸氨基转移酶线粒' | 医疗就诊94037456658中天冬酸氨基转移酶线粒在三大目录类别里面是哪个类别的
|
<table0>[table_name_28] { <col0>[year]:[VARCHAR] <col1>[result]:[VARCHAR] <col2>[venue]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "3rd" AND `<col2>` = "edinburgh, scotland" | What is the total number of years wehre anna thompson had a 3rd place result at edinburgh, scotland?
|
<table0>[table_12116] { <col0>[Mininera]:[DFL] <col1>[text]:[Wins] <col2>[real]:[Byes] <col3>[real]:[Losses] <col4>[real]:[Draws] <col5>[real]:[real] } | SELECT SUM( "Byes" ) FROM `<table0>` WHERE "Wins" < '16' AND "Losses" = '8' AND "Mininera DFL" = 'penshurst' AND "Against" < '1405' | WHAT ARE THE BYES WITH A WIN SMALLER THAN 16, 8 LOSSES, AND AT PENSHURST, WITH AGAINST SMALLER THAN 1405?
|
<table0>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstay... | SELECT COUNT( * ) > 0 FROM `<table4>` WHERE `<table4>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '032-9230' ) ) AND `<table4>`.drugname = ... | was the dulcolax prescribed to patient 032-9230 this month? |
<table0>[table_name_9] { <col0>[lost]:[INTEGER] <col1>[points_1]:[VARCHAR] <col2>[goals_against]:[VARCHAR] } | SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` > 58 AND `<col2>` = 66 | What is the maximum lost with points 1 more than 58 and 66 goals against?
|
<table0>[crops] { <col0>[INT]:[crop_name] <col1>[VARCHAR]:[yield_mt_ha] <col2>[INT]:[area_ha] <col3>[INT]:[INSERT] } | SELECT crop_name, AVG( yield_mt_ha ) as avg_yield_mt_ha, SUM( yield_mt_ha * area_ha * 0.01 ) as total_production_mt FROM `<table0>` WHERE crop_name IN ( 'Quinoa', 'Amaranth' ) GROUP BY crop_name; | What is the average yield, in metric tons per hectare, of 'Quinoa' and 'Amaranth' crops, and the total production, in metric tons, for those crops? |
<table0>[table_10696] { <col0>[Party]:[text] <col1>[1999]:[Election] <col2>[real]:[2003] <col3>[Election]:[real] <col4>[2007]:[Election] <col5>[real]:[2010] <col6>[real]:[2011] <col7>[Election]:[real] <col8>[2012]:[real] } | SELECT SUM( "2003 Election" ) FROM `<table0>` WHERE "May 2010" = '5' AND "1999 Election" < '6' | What is the total of the 2003 election but also had 5 in May 2010 and also less than 6 in 1999? |
<table0>[table_52222] { <col0>[County]:[text] <col1>[1900]:[real] <col2>[1930]:[real] <col3>[1950]:[real] <col4>[2000]:[real] <col5>[2006]:[est] } | SELECT MAX( "1930" ) FROM `<table0>` WHERE "2000" = '43,966' AND "1900" < '8,401' | What is the highest 1930 population when the 2000 population is 43,966 and the 1900 population is less than 8,401? |
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvalue... | SELECT COUNT( DISTINCT t1.uniquepid ) FROM ( SELECT patient.uniquepid, `<table9>`.`<table9>`time FROM `<table9>` JOIN patient ON `<table9>`.patientunitstayid = patient.patientunitstayid WHERE `<table9>`.`<table9>`name = 'anemia - anemia of chronic disease' ) AS t1 JOIN ( SELECT patient.uniquepid, `<table4>`.drugstartti... | how many patients were prescribed kcl in dextrose-nacl 20-5-0.45 meq/l-%-% iv soln within 2 months after the diagnosis with anemia - anemia of chronic disease? |
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heartrate]:[... | SELECT COUNT( DISTINCT `<table8>`.`<table8>`healthsystemstayid ) FROM `<table8>` WHERE `<table8>`.uniquepid = '006-167444' AND DATETIME( `<table8>`.hospitaladmittime ) <= DATETIME( CURRENT_TIME( ), '-4 year' ) | how many times does patient 006-167444 come to the hospital until 4 years ago.
|
<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>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[time] <col4>[disc... | SELECT COUNT( * ) > 0 FROM `<table4>` WHERE `<table4>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 57899 ) AND DATETIME( `<table4>`.startdate, 'start of year' ) = DATETIME( CURRENT_TIME( ), 'start of year', '-0 year' ) | a medication has been prescribed to patient 57899 this year?
|
<table0>[table_name_57] { <col0>[safari]:[VARCHAR] <col1>[chrome]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2.05%" | What percentage of browsers were using Safari during the period in which 2.05% were using Chrome? |
<table0>[table_41167] { <col0>[Episode]:[Number] <col1>[real]:[Air] <col2>[Date]:[text] <col3>[Guest]:[Host] <col4>[text]:[Musical] <col5>[Guest]:[Song] <col6>[performed]:[text] <col7>[knows]:[guest] <col8>[host]:[panelists] } | SELECT MAX( "Episode Number" ) FROM `<table0>` WHERE "Guest Host" = 'jamie oliver' | What is the highest episode number in which Jamie Oliver guest-hosted?
|
<table0>[table_name_85] { <col0>[round]:[VARCHAR] <col1>[venue]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "villa park" | What was the round for Villa Park? |
<table0>[enzyme] { <col0>[int]:[name] <col1>[text]:[Location] <col2>[text]:[Product] <col3>[text]:[Chromosome] <col4>[text]:[OMIM] <col5>[int]:[Porphyria] } <table1>[medicine] { <col0>[int]:[name] <col1>[text]:[Trade_Name] <col2>[text]:[FDA_approved] } <table2>[medicine_enzyme_interaction] { <col0>[enzyme_id]:[int] <... | SELECT name, id FROM `<table1>` AS T1 JOIN `<table1>`_enzyme_interaction AS T2 ON T2.`<table1>`_id = T1.id | Show me a pie chart for what are the ids and names of the medicine that can interact with two or more enzymes? |
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>... | SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN prescriptions ON `<table0>`.hadm_id = prescriptions.hadm_id WHERE `<table0>`.admission_type = "EMERGENCY" AND prescriptions.route = "IV" | what is the number of patients whose admission type is emergency and drug route is iv?
|
<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 COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` WHERE `<table2>`.discharge_location = "SNF" AND `<table2>`.diagnosis = "UPPER GI BLEED" | provide the number of patients whose discharge location is snf and primary disease is upper gi bleed? |
<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>` INNER JOIN procedures ON `<table1>`.hadm_id = procedures.hadm_id WHERE `<table1>`.age < "85" AND procedures.icd9_code = "3806" | give the number of patients who are less than 85 years old and 3806 as the procedure icd9 code. |
<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 diagnoses ON `<table3>`.hadm_id = diagnoses.hadm_id WHERE `<table3>`.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND diagnoses.short_title = "Blood in stool" | how many patients whose discharge location is left against medical advi and diagnoses short title is blood in stool? |
<table0>[EmployeeData] { <col0>[EmployeeID]:[INT] <col1>[Sector]:[VARCHAR] <col2>[WeeklyHours]:[DECIMAL] } | SELECT SUM( * ) FROM `<table0>` WHERE `<col1>` = 'Technology' AND `<col2>` > 45; | What is the total number of employees in the 'Technology' sector who work more than 45 hours per week? |
<table0>[table_204_928] { <col0>[number]:[year] <col1>[number]:[album] <col2>[text]:[territory] <col3>[text]:[label] <col4>[text]:[notes] } | SELECT "year" FROM `<table0>` WHERE "album" = 'jezebel' | what year did the album jezebel on blockshok records release ? |
<table0>[table_77447] { <col0>[Game]:[text] <col1>[Date]:[text] <col2>[Opponent]:[text] <col3>[Result]:[text] <col4>[Dolphins]:[points] <col5>[text]:[Opponents] <col6>[Points]:[text] <col7>[Record]:[text] <col8>[Streak]:[text] <col9>[Attendance]:[text] } | SELECT "Attendance" FROM `<table0>` WHERE "Opponent" = 'oakland raiders' | What was the attendance of the Oakland Raiders game?
|
<table0>[area] { <col0>[course_id]:[int] } <table1>[requirement] { <col0>[requirement_id]:[int] } <table2>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table3>[program] { <col0>[program_id]:[int] <col1>[name]:[varchar] <col2>[college]:[varchar] <col3>[introduction]:[varchar] } <table4>[gsi] {... | SELECT DISTINCT course.department, course.name, course.number FROM `<table17>` INNER JOIN course ON `<table17>`.course_id = course.course_id WHERE course.department = 'BUDDHST' | For CS majors what BUDDHST prerequistes needed ? |
<table0>[exists] { <col0>[events]:[INT] <col1>[name]:[VARCHAR] <col2>[255]:[region] <col3>[VARCHAR]:[255] <col4>[attendance]:[INT] <col5>[INSERT]:[events] <col6>[name]:[region] <col7>[attendance]:[VALUES] <col8>[Ballet]:[Northeast] <col9>[200]:[Tango] <col10>[Southwest]:[150] <col11>[Salsa]:[Southeast] <col12>[250]:[Hi... | SELECT region, MAX( attendance ) FROM events WHERE name LIKE '%dance%'; | Which region had the highest total attendance at dance events? |
<table0>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col5>[drugstarttime]:[time] <col6>[drugstoptime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>... | SELECT COUNT( * ) FROM `<table5>` WHERE `<table5>`.`<table5>`name = 'tracheostomy' AND DATETIME( `<table5>`.`<table5>`time ) <= DATETIME( CURRENT_TIME( ), '-4 year' ) | how many times has was the tracheostomy procedure done until 4 years ago? |
<table0>[people] { <col0>[Customer]:[text] <col1>[Customer]:[text] <col2>[Segment]:[text] <col3>[Country]:[text] <col4>[City]:[text] <col5>[State]:[text] <col6>[Postal]:[Code] <col7>[integer]:[Region] } <table1>[product] { <col0>[Product]:[text] <col1>[Product]:[text] <col2>[Category]:[text] <col3>[Sub]:[Category] <co... | SELECT DISTINCT T3.`Product Name` FROM `<table5>` AS T1 INNER JOIN people AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T1.`Product ID` WHERE T2.`Customer Name` = 'Matt Abelman' AND STRFTIME( '%Y', T1.`Order Date` ) = '2013' | List the products ordered by Matt Abelman from the Western store in 2013. |
<table0>[table_30621] { <col0>[real]:[Driver] <col1>[text]:[Entrant] <col2>[text]:[Constructor] <col3>[text]:[Chassis] <col4>[text]:[Engine] } | SELECT MIN( "No" ) FROM `<table0>` WHERE "Driver" = 'Nello Pagani' | Name the least number for nello pagani
|
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[dosage]:[text] <col4>[routeadmin]:[text] <col... | SELECT COUNT( DISTINCT t2.uniquepid ) FROM ( SELECT t1.uniquepid, t1.`<table2>`time FROM ( SELECT `<table8>`.uniquepid, `<table2>`.`<table2>`time FROM `<table2>` JOIN `<table8>` ON `<table2>`.`<table8>`unitstayid = `<table8>`.`<table8>`unitstayid WHERE `<table2>`.`<table2>`name = 'hypovolemic shock - hemorrhagic' ) AS ... | count the number of people that died after being diagnosed with hypovolemic shock - hemorrhagic within the same month since 2105.
|
<table0>[table_47748] { <col0>[Elector]:[text] <col1>[Nationality]:[text] <col2>[Order]:[title] <col3>[text]:[Elevated] <col4>[text]:[Elevator] } | SELECT "Elevator" FROM `<table0>` WHERE "Order and title" = 'cardinal-priest of s. prassede' | The Cardinal-Priest of S. Prassede order and title has who as the elevator?
|
<table0>[table_14342592_5] { <col0>[touchdowns]:[VARCHAR] <col1>[points]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 22 | When the total points are 22 how many total touchdowns have been made?
|
<table0>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[ReviewTaskTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table2>[ReviewTaskStates] { <col0>[number]:[text] <col1>[Description]:[text] } <table3>[Tags] { <col0>[number]:[TagName] <col1>[text]:[Count] <col2>[number]:... | SELECT pl.PostId AS "post_link", pl.RelatedPostId AS "post_link" FROM `<table26>` AS pl JOIN Posts AS p ON p.Id = pl.RelatedPostId WHERE p.Id = '##questionId##' AND p.PostTypeId = 1 AND pl.LinkTypeId = 3 | Search for questions that were closed as duplicate to one of your questions.
|
<table0>[month] { <col0>[month_number]:[int] <col1>[month_name]:[text] } <table1>[city] { <col0>[city_code]:[varchar] <col1>[city_name]:[varchar] <col2>[state_code]:[varchar] <col3>[country_name]:[varchar] <col4>[time_zone_code]:[varchar] } <table2>[airline] { <col0>[airline_code]:[varchar] <col1>[airline_name]:[text... | SELECT DISTINCT flight.flight_id FROM `<table18>` AS AIRPORT_SERVICE_0, `<table18>` AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ( ( date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time = 650... | i would like to fly from DALLAS to DENVER on the morning of 8 27 leaving at 650 |
<table0>[public_defenders] { <col0>[defender_id]:[INT] <col1>[defender_state]:[VARCHAR] } | SELECT pd.defender_state, COUNT( dd.defendant_id ) FROM `<table0>` pd INNER JOIN defendant_data dd ON pd.defender_id = dd.defender_id GROUP BY pd.defender_state; | How many defendants were represented by public defenders for each state? |
<table0>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table1>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table2>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar]... | SELECT JOB_ID, SUM( `<col10>` ) FROM `<table2>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40 GROUP BY `<col6>` ORDER BY SUM( `<col10>` ) | 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 sum of department_id over the job_id , and group by attribute job_id, and could you rank Y-axis from low to high order?
|
<table0>[water_conservation] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[location] <col2>[VARCHAR]:[water_savings] } | CREATE TABLE water_conservation ( id INT PRIMARY KEY, location VARCHAR( 50 ), water_savings FLOAT ); | Create a table named 'water_conservation' |
<table0>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table1>[ReviewTaskResults] { <col0>[number]:[ReviewTaskId] <col1>[number]:[ReviewTaskResultTypeId] <col2>[number]:[CreationDate] <col3>[time]:[RejectionReasonId] <col4>[number]:[Comme... | SELECT COUNT( q.Body ), q.OwnerUserId, q.OwnerDisplayName FROM `<table23>` AS q WHERE ( REPLACE( REPLACE( q.Body, '\\', '' ), ' ', 'X' ) LIKE '%\XXXX%' ) AND q.OwnerUserId IN ( SELECT p.OwnerUserId FROM `<table23>` AS p WHERE ( REPLACE( REPLACE( p.Body, '\\', '' ), ' ', 'X' ) LIKE '%\XXXX%' ) AND q.AcceptedAnswerId != ... | TeX.SX \\ corruption (grouped by id). |
<table0>[table_name_31] { <col0>[year]:[VARCHAR] } | SELECT 250 AS _cc FROM `<table0>` WHERE `<col0>` = "1987" | Who won the 250 cc in 1987? |
<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 `<table4>`.icd9_code FROM `<table4>` WHERE `<table4>`.subject_id = "3623" | specify the icd9 code for patient id 3623 |
<table0>[WeatherData] { <col0>[location]:[TEXT] <col1>[month]:[INTEGER] <col2>[year]:[INTEGER] <col3>[temperature]:[REAL] } | SELECT MIN( `<col3>` ) FROM `<table0>` WHERE `<col0>` = 'Iceland' AND `<col1>` = 12; | What is the minimum temperature recorded in Iceland during December across all years? |
<table0>[table_20010140_10] { <col0>[location_attendance]:[VARCHAR] <col1>[record]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "15–10 ( 5–7 )" | state the number of location attendance where record is 15–10 (5–7) |
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table2>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[va... | SELECT HIRE_DATE, AVG( `<col9>` ) FROM `<table2>` WHERE NOT `<col0>` IN ( SELECT `<col0>` FROM `<table3>` ) ORDER BY AVG( `<col9>` ) | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by time, and could you sort total number from low to high order? |
<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>`.admission_type = "ELECTIVE" AND `<table2>`.admityear < "2148" | what is the number of patients whose admission type is elective and admission year is less than 2148?
|
<table0>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table1>[food_service] { <col0>[meal_code]:[text] <col1>[meal_number]:[int] <col2>[compartment]:[text] <col3>[meal_description]:[varchar] } <table2>[fare_basis] { <col0>[fare_basis_code]:[text] <col1>[booking_class]:[text] <col2>[class_t... | 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 = 'MONTREAL' AND date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.... | i need a flight from NEW YORK to MONTREAL tomorrow
|
<table0>[treatment] { <col0>[treatmentid]:[number] <col1>[patientunitstayid]:[number] <col2>[treatmentname]:[text] <col3>[treatmenttime]:[time] } <table1>[cost] { <col0>[costid]:[number] <col1>[uniquepid]:[text] <col2>[patienthealthsystemstayid]:[number] <col3>[eventtype]:[text] <col4>[eventid]:[number] <col5>[charget... | SELECT `<table9>`.`<table9>`result FROM `<table9>` WHERE `<table9>`.`<table4>`unitstayid IN ( SELECT `<table4>`.`<table4>`unitstayid FROM `<table4>` WHERE `<table4>`.`<table4>`healthsystemstayid IN ( SELECT `<table4>`.`<table4>`healthsystemstayid FROM `<table4>` WHERE `<table4>`.uniquepid = '010-20205' ) ) AND `<table9... | what were the first ast (sgot) from patient 010-20205 in 08/last year?
|
<table0>[SafetyIncidents] { <col0>[INT]:[IncidentDate] <col1>[DATE]:[FacilityID] <col2>[INT]:[INSERT] } | SELECT FacilityID, DATE_FORMAT( IncidentDate, '%Y-%m' ) as Month, COUNT( * ) as IncidentCount FROM `<table0>` WHERE IncidentDate >= '2020-07-01' AND IncidentDate < '2020-10-01' GROUP BY FacilityID, Month; | How many safety incidents occurred in Q3 2020 for each facility? |
<table0>[table_203_324] { <col0>[number]:[chord] <col1>[text]:[root] <col2>[text]:[major] <col3>[text]:[perfect] <col4>[fifth]:[text] <col5>[minor]:[seventh] } | SELECT COUNT( * ) FROM `<table0>` | what 's the total number of thirds you can make on a 7th form chord ?
|
<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 COUNT( * ) > 0 FROM `<table4>` WHERE `<table4>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1>` WHERE `<table1>`.uniquepid = '015-66570' ) ) AND `<table4>`.cellpath L... | did patient 015-66570 had urine output since 02/2104? |
<table0>[table_78013] { <col0>[Region]:[text] <col1>[Date]:[text] <col2>[Label]:[text] <col3>[Format]:[text] <col4>[Catalogue]:[text] } | SELECT "Catalogue" FROM `<table0>` WHERE "Date" = 'october 15, 2004' | Name the october 15, 2004 catalogue
|
<table0>[table_name_12] { <col0>[date_of_appointment]:[VARCHAR] <col1>[outgoing_manager]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "paco chaparro" | What was the date of appointment for paco chaparro's replacement? |
<table0>[Order_Items] { <col0>[order_item_id]:[INTEGER] <col1>[order_id]:[INTEGER] <col2>[product_id]:[INTEGER] <col3>[product_quantity]:[VARCHAR] <col4>[other_order_item_details]:[VARCHAR] } <table1>[Product_Categories] { <col0>[production_type_code]:[VARCHAR] <col1>[product_type_description]:[VARCHAR] <col2>[vat_rat... | SELECT account_name, COUNT( * ) FROM `<table4>` AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | Show the relationship between account name and the number of transactions for each account in a scatter chart.
|
<table0>[table_name_68] { <col0>[score]:[VARCHAR] <col1>[date]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "april 11, 2007" | What was the final score for the match held on April 11, 2007? |
<table0>[ArtPieces] { <col0>[INT]:[title] <col1>[VARCHAR]:[galleryId] <col2>[INT]:[year] <col3>[INT]:[value] <col4>[INT]:[artistId] <col5>[INT]:[INSERT] } | UPDATE ArtPieces SET value = value * 1.1 WHERE artistId = 1; | Update the value of art pieces by artist 'Ojo' by 10% |
<table0>[station_company] { <col0>[Station_ID]:[int] <col1>[Company_ID]:[int] <col2>[Rank_of_the_Year]:[int] } <table1>[gas_station] { <col0>[Station_ID]:[int] <col1>[Open_Year]:[int] <col2>[Location]:[text] <col3>[Manager_Name]:[text] <col4>[Vice_Manager_Name]:[text] <col5>[Representative_Name]:[text] } <table2>[com... | SELECT Headquarters, COUNT( `<col3>` ) FROM `<table2>` GROUP BY `<col3>` ORDER BY COUNT( `<col3>` ) DESC | Bar chart of how many headquarters from each headquarters, could you sort from high to low by the Y-axis?
|
<table0>[table_203_545] { <col0>[number]:[single] <col1>[text]:[release] <col2>[date]:[text] <col3>[label]:[text] <col4>[format]:[text] <col5>[singles]:[chart] <col6>[position]:[number] <col7>[notes]:[text] } | SELECT "format( s )" FROM `<table0>` GROUP BY "format( s )" ORDER BY COUNT( * ) DESC LIMIT 1 | which format was used the most according to this chart ?
|
<table0>[lab] { <col0>[labid]:[number] <col1>[patientunitstayid]:[number] <col2>[labname]:[text] <col3>[labresult]:[number] <col4>[labresulttime]:[time] } <table1>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric... | SELECT `<table1>`.`<table1>`time FROM `<table1>` WHERE `<table1>`.`<table4>`unitstayid IN ( SELECT `<table4>`.`<table4>`unitstayid FROM `<table4>` WHERE `<table4>`.`<table4>`healthsystemstayid IN ( SELECT `<table4>`.`<table4>`healthsystemstayid FROM `<table4>` WHERE `<table4>`.uniquepid = '017-20711' ) ) AND `<table1>`... | when was the first time patient 017-20711 had a output (ml)-urethral catheter double-lumen 14 fr. output on last month/12. |
<table0>[table_name_78] { <col0>[home_team]:[VARCHAR] } | SELECT `<col0>` AS score FROM `<table0>` WHERE `<col0>` = "north melbourne" | When the home team north melbourne was playing what did they score?
|
<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 `<table11>`.admittime FROM `<table11>` WHERE `<table11>`.subject_id = 65467 AND STRFTIME( '%y', `<table11>`.admittime ) <= '2104' | tell me patient 65467's hospital admission time until 2104?
|
<table0>[table_203_447] { <col0>[number]:[constituency] <col1>[number]:[region] <col2>[text]:[name] <col3>[text]:[party] <col4>[text]:[elected] } | SELECT "name" FROM `<table0>` WHERE id = 1 | what is the first name on the table ?
|
<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>`.age < "45" AND procedures.long_title = "Allogeneic hematopoietic stem cell transpant without purging" | what is the number of patients with allogeneic hematopoietic stem cell transplant without purging who are under 45 years? |
<table0>[security_incidents] { <col0>[INT]:[incident_date] <col1>[DATE]:[country] <col2>[VARCHAR]:[INSERT] } | SELECT country, COUNT( * ) as incident_count FROM `<table0>` WHERE incident_date >= DATEADD( month, -1, GETDATE( ) ) GROUP BY country ORDER BY incident_count DESC LIMIT 3; | What are the top 3 countries with the most security incidents in the past month? |
<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 `<table3>`.subject_id ) FROM `<table3>` INNER JOIN prescriptions ON `<table3>`.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "INHALATION" | what is the number of patients whose drug route is inhalation? |
<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 T2.company_id FROM `<table7>` AS T1 INNER JOIN `<table7>`_company AS T2 ON T1.`<table7>`_id = T2.`<table7>`_id WHERE T1.title = 'Gladiator' | What is the ID of the production company which produced the movie "Gladiator"? |
<table0>[green_buildings] { <col0>[INT]:[square_footage] <col1>[FLOAT]:[energy_rating] } | UPDATE green_buildings SET energy_rating = 80 WHERE id = 3; | Update the energy rating of a property in the 'green_buildings' table with id 3 to 80. |
<table0>[table_17111812_1] { <col0>[seventh]:[VARCHAR] <col1>[sixth]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Interpol" | When Interpol is in 6th, who is in 7th? |
<table0>[table_203_43] { <col0>[number]:[polling] <col1>[firm]:[text] <col2>[month]:[text] <col3>[link]:[text] <col4>[favor]:[number] <col5>[oppose]:[number] } | SELECT "favor" FROM `<table0>` WHERE "polling firm" = 'rutgers-eagleton' AND "month" = 'march 2014' | how many in favor votes did rutgers eagleton give in march 2014 ?
|
<table0>[problems] { <col0>[problem_id]:[VARCHAR] <col1>[reported_by_staff_id]:[VARCHAR] } <table1>[staff] { <col0>[staff_id]:[VARCHAR] <col1>[staff_last_name]:[VARCHAR] } | SELECT T1.problem_id FROM `<table0>` AS T1 JOIN staff AS T2 ON T1.reported_by_staff_id = T2.staff_id WHERE T2.staff_last_name = "Bosco" | Find the ids of the problems that are reported by the staff whose last name is Bosco. |
<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>`.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND `<table0>`.days_stay > "13" | count the number of patients whose admission location is transfer from hosp/extram and days of hospital stay is greater than 13?
|
<table0>[table_74116] { <col0>[Team]:[text] <col1>[Outgoing]:[manager] <col2>[text]:[Manner] <col3>[departure]:[text] <col4>[Date]:[vacancy] <col5>[text]:[Replaced] <col6>[text]:[Date] <col7>[appointment]:[text] <col8>[Position]:[table] } | SELECT "Position in table" FROM `<table0>` WHERE "Date of appointment" = '17 January 2011' | What was the position of appointment date 17 january 2011
|
<table0>[table_15162479_8] { <col0>[nominee]:[VARCHAR] <col1>[net_vote]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "15.17%" | How many nominees had a net voice of 15.17% |
<table0>[financial_capability] { <col0>[individual_id]:[TEXT] <col1>[training_date]:[DATE] <col2>[country]:[TEXT] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` >= DATEADD( year, -1, CURRENT_DATE ) AND `<col2>` = 'Europe'; | What is the number of individuals in Europe who have received financial capability training in the last 12 months? |
<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>`.ethnicity = "BLACK/HAITIAN" AND `<table0>`.admityear < "2123" | give me the number of patients whose ethnicity is black/haitian and admission year is less than 2123? |
<table0>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table1>[PostTypes] { <col0>[number]:[text] } <table2>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table3>[PostTags] { <... | SELECT DATEADD( m, DATEDIFF( m, 0, CreationDate ), 0 ) AS month, CAST( SUM( CASE WHEN `<table24>`.VoteTypeId = 2 THEN 1 ELSE 0 END ) AS FLOAT ) / COUNT( DISTINCT Posts.Id ) AS upvotes_per_post, CAST( SUM( CASE WHEN `<table24>`.VoteTypeId = 3 THEN 1 ELSE 0 END ) AS FLOAT ) / COUNT( DISTINCT Posts.Id ) AS downvotes_per_p... | upvotes and downvotes per post in first week by month.
|
<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>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[admittime]:[... | SELECT t1.drug FROM ( SELECT `<table8>`.drug, COUNT( `<table8>`.startdate ) AS c1 FROM `<table8>` WHERE `<table8>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 1902 ) AND STRFTIME( '%y-%m', `<table8>`.startdate ) = '2105-12' GROUP BY `<table8>`.drug ) AS t1 WHERE t1.c1 >= 2 | what drug has patient 1902 been prescribed two or more times in 12/2105?
|
<table0>[county_public_safety] { <col0>[County_ID]:[int] <col1>[text]:[Population] <col2>[int]:[Police_officers] <col3>[int]:[Residents_per_officer] <col4>[int]:[Case_burden] <col5>[int]:[Crime_rate] <col6>[real]:[Police_force] <col7>[text]:[Location] } <table1>[city] { <col0>[City_ID]:[int] <col1>[County_ID]:[int] <c... | SELECT T2.Name, COUNT( T2.Name ) FROM `<table1>` AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY COUNT( T2.Name ) DESC | Show the number of cities in each country with a bar chart, and order y axis from high to low order. |
<table0>[Ref_Document_Types] { <col0>[Document_Type_Code]:[text] <col1>[Document_Type_Name]:[text] <col2>[Document_Type_Description]:[text] } <table1>[Ref_Calendar] { <col0>[Calendar_Date]:[time] <col1>[Day_Number]:[number] } <table2>[Ref_Locations] { <col0>[Location_Code]:[text] <col1>[Location_Name]:[text] <col2>[L... | SELECT T2.document_type_name FROM All_documents AS T1 JOIN Ref_document_types AS T2 ON T1.document_type_code = T2.document_type_code WHERE T1.document_name = "How to read a book" | Find the document type name of the document named "How to read a book". |
<table0>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[text] <col4>[long_title]:[text] } <table1>[diagnoses] { <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 diagnoses ON `<table2>`.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Malignant neoplasm of other sites of tongue" AND prescriptions.route = "NU" | how many patients whose diagnoses long title is malignant neoplasm of other sites of tongue and drug route is nu?
|
<table0>[company] { <col0>[Company_ID]:[int] <col1>[Rank]:[int] <col2>[Company]:[text] <col3>[Headquarters]:[text] <col4>[Main_Industry]:[text] <col5>[Sales_billion]:[real] <col6>[Profits_billion]:[real] <col7>[Assets_billion]:[real] <col8>[Market_Value]:[real] } <table1>[station_company] { <col0>[Station_ID]:[int] <c... | SELECT Main_Industry, SUM( `<col8>` ) FROM `<table0>` GROUP BY `<col4>` | I want to know the proportion of the sum market value for each main industry. |
<table0>[month] { <col0>[month_number]:[int] <col1>[month_name]:[text] } <table1>[dual_carrier] { <col0>[main_airline]:[varchar] <col1>[low_flight_number]:[int] <col2>[high_flight_number]:[int] <col3>[dual_airline]:[varchar] <col4>[service_name]:[text] } <table2>[days] { <col0>[days_code]:[varchar] <col1>[day_name]:[... | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flig... | i'm sorry i want to book a flight from ATLANTA to DENVER colorado
|
<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>[Customers] { <col0>[Customer_ID]:[INTEGER] <col1>[Customer_Details]:[VARCHAR] } <table2>[Payments] { <... | SELECT Payment_Method_Code, AVG( Amount_Payment ) FROM `<table2>` GROUP BY `<col2>` ORDER BY `<col2>` DESC | What about the average amounts of payments by each method code? You can give me a bar chart, display from high to low by the X.
|
<table0>[table_name_5] { <col0>[player]:[VARCHAR] <col1>[college]:[VARCHAR] } | SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "memphis" | What Player is from the College of memphis? |
<table0>[Roles] { <col0>[Role_Code]:[CHAR] <col1>[Role_Name]:[VARCHAR] <col2>[255]:[Role_Description] <col3>[VARCHAR]:[255] } <table1>[Documents_to_be_Destroyed] { <col0>[Document_ID]:[INTEGER] <col1>[Destruction_Authorised_by_Employee_ID]:[INTEGER] <col2>[Destroyed_by_Employee_ID]:[INTEGER] <col3>[Planned_Destruction... | SELECT Date_in_Location_From, COUNT( `<col2>` ) FROM `<table2>` GROUP BY `<col2>` | Show the number of documents in different starting date and group by starting date with a line chart. |
<table0>[co2_emissions] { <col0>[INT]:[sector] <col1>[VARCHAR]:[255] <col2>[year]:[INT] } | SELECT sector, SUM( `<table0>` ) FROM `<table0>` WHERE sector = 'Transportation' AND `<col2>` = 2018 GROUP BY sector; | CO2 emissions of the transportation sector in 2018 |
<table0>[CommunityHealthWorkers] { <col0>[WorkerID]:[INT] <col1>[Race]:[VARCHAR] <col2>[255]:[Score] <col3>[INT]:[INSERT] } | SELECT Race, MIN( Score ) as MinScore FROM `<table0>` GROUP BY Race; | What is the minimum cultural competency score of community health workers in each race? |
<table0>[table_15887683_5] { <col0>[ppv]:[VARCHAR] <col1>[television_service]:[VARCHAR] } | SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "Sky Cinema 1" | How many PPV values are listed for when television service Sky Cinema 1? |
<table0>[kangaroos] { <col0>[INT]:[name] <col1>[VARCHAR]:[species] <col2>[VARCHAR]:[weight] <col3>[INT]:[gender] <col4>[VARCHAR]:[INSERT] } | SELECT MAX( weight ) FROM `<table0>` WHERE gender = 'Male' AND species = 'Kangaroo'; | What is the maximum weight of male kangaroos in the "kangaroos" table? |
<table0>[VesselArrivals] { <col0>[INT]:[VesselName] <col1>[VARCHAR]:[ArrivalPort] <col2>[VARCHAR]:[ArrivalDate] <col3>[DATE]:[INSERT] } | SELECT COUNT( * ) FROM `<table0>` WHERE ArrivalPort = 'Dar es Salaam' AND ArrivalDate >= DATEADD( day, -90, GETDATE( ) ); | How many vessels arrived in Dar es Salaam in the past 90 days? |
<table0>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table1>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[Mar... | SELECT P.Id AS PostID, P.Title, P.Body FROM `<table6>` AS P INNER JOIN `<table6>` AS A ON P.AcceptedAnswerId = A.Id INNER JOIN PostTags AS PT ON P.Id = PT.PostId INNER JOIN Tags AS T ON T.Id = PT.TagId WHERE T.TagName LIKE 'azure-ad-b2c' AND P.Score > -1 AND P.PostTypeId = 1 | [Microsoft AAD B2C] Average answer response time in hours MoM. |
<table0>[ReviewRejectionReasons] { <col0>[number]:[text] <col1>[Description]:[text] <col2>[PostTypeId]:[number] } <table1>[Users] { <col0>[number]:[Reputation] <col1>[number]:[CreationDate] <col2>[time]:[DisplayName] <col3>[text]:[LastAccessDate] <col4>[time]:[WebsiteUrl] <col5>[text]:[Location] <col6>[text]:[AboutMe]... | SELECT p.Id AS "post_link", pt.Name AS PostType, p.CreationDate, u.DisplayName AS PostWrittenBy, p.Body FROM `<table2>` AS p JOIN PostTypes AS pt ON p.PostTypeId = pt.Id JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.Body LIKE '%http://www.faa.gov/air_traffic/publications/atpubs/pcg/%' ORDER BY p.CreationDate | Posts which used HTML version of FAA P/CG. |
<table0>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icd9_code]:[text] <col4>[charttime]:[time] } <table1>[d_items] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] <col3>[linksto]:[text] } <table2>[labevents] { <col0>[row_id]:[number] <co... | SELECT `<table4>`.startdate FROM `<table4>` WHERE `<table4>`.hadm_id IN ( SELECT `<table12>`.hadm_id FROM `<table12>` WHERE `<table12>`.subject_id = 53015 ) AND `<table4>`.drug = 'nystatin ointment' AND STRFTIME( '%y-%m', `<table4>`.startdate ) <= '2103-08' ORDER BY `<table4>`.startdate LIMIT 1 | when was patient 53015 prescribed nystatin ointment first until 08/2103?
|
<table0>[PostLinks] { <col0>[number]:[CreationDate] <col1>[time]:[PostId] <col2>[number]:[RelatedPostId] <col3>[number]:[LinkTypeId] } <table1>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Com... | SELECT `<table15>`.Id AS "user_link", `<table15>`.Id AS "user_id", COUNT( quest.Id ) AS "total_questions", COUNT( quest.AcceptedAnswerId ) AS "accepted_answers", CONCAT( CASE COUNT( quest.Id ) WHEN 0 THEN 0 ELSE COUNT( quest.AcceptedAnswerId ) * 100 / COUNT( quest.Id ) END, ' %' ) AS "%_accepted" FROM `<table15>` LEFT ... | How often does a user Accept Answers to their Questions. Calculate how often a user actually Accepts answers to their Questions (including their own answers)
|
<table0>[Workouts] { <col0>[INT]:[workout_date] <col1>[DATE]:[INSERT] } | SELECT COUNT( * ) FROM `<table0>` WHERE workout_date BETWEEN '2022-01-01' AND '2022-01-31'; | How many workouts were performed in January 2022? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.