schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[table_49568] { <col0>[Date]:[text] <col1>[text]:[Opponent] <col2>[text]:[Score] <col3>[text]:[Record] }
SELECT "Opponent" FROM `<table0>` WHERE "Record" = '0-12'
What was the opponent of the game when the reocrd was 0-12?
<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 MAX( `<table1>`.age ) FROM `<table1>` WHERE `<table1>`.days_stay = "11" AND `<table1>`.dod_year < "2154.0"
what is maximum age of patients whose days of hospital stay is 11 and year of death is less than 2154?
<table0>[d_icd_diagnoses] { <col0>[row_id]:[number] <col1>[icd9_code]:[text] <col2>[short_title]:[text] <col3>[long_title]:[text] } <table1>[icustays] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[first_careunit]:[text] <col5>[last_careunit]:[text] <c...
SELECT t2.drug FROM ( SELECT admissions.subject_id, `<table11>`.charttime, admissions.hadm_id FROM `<table11>` JOIN admissions ON `<table11>`.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 62298 AND `<table11>`.icd9_code = ( SELECT `<table0>`.icd9_code FROM `<table0>` WHERE `<table0>`.short_title = 'hyperli...
what drug was patient 62298 prescribed for within the same hospital visit after being diagnosed with hyperlipidemia nec/nos since 04/2103?
<table0>[Services] { <col0>[Service]:[VARCHAR] <col1>[Revenue]:[INT] } <table1>[Customers] { <col0>[CustomerID]:[INT] <col1>[Service]:[VARCHAR] <col2>[Region]:[VARCHAR] }
SELECT SUM( s.Revenue ) as TotalRevenue FROM `<table0>` s JOIN Customers c ON s.Service = c.Service WHERE s.Service = 'Broadband' AND c.Region = 'Southern';
What is the total revenue from 'Broadband' services in the 'Southern' region?
<table0>[table_12909] { <col0>[Elector]:[text] <col1>[Nationality]:[text] <col2>[Order]:[text] <col3>[Title]:[text] <col4>[Elevated]:[text] <col5>[Elevator]:[text] }
SELECT "Elevated" FROM `<table0>` WHERE "Elector" = 'matteo orsini rosso'
Which Elevated has an Elector of matteo orsini rosso?
<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>[record] { <col0>[int]:[Result] <col1>[text]:[Sw...
SELECT name, COUNT( name ) FROM `<table0>` AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY name
A bar chart for finding the number of the names of swimmers who has a result of 'win', and rank X in asc order.
<table0>[table_51118] { <col0>[Place]:[text] <col1>[Player]:[text] <col2>[Country]:[text] <col3>[Score]:[text] <col4>[par]:[text] }
SELECT "Country" FROM `<table0>` WHERE "Score" = '70-71-72=213'
Which country has a score of 70-71-72=213?
<table0>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[varchar] <col4>[minutes_distant]:[int] } <table1>[equipment_sequence] { <col0>[aircraft_code_sequence]:[varchar] <col1>[aircraft_code]:[varchar] } <table2>[flight_stop] { <col0>[flight...
SELECT DISTINCT flight.flight_id FROM `<table0>` AS AIRPORT_SERVICE_0, `<table0>` 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' ...
what flights are there from PITTSBURGH to LOS ANGELES
<table0>[awards_players] { <col0>[playerID]:[text] <col1>[award]:[text] <col2>[year]:[integer] <col3>[lgID]:[text] <col4>[note]:[text] <col5>[pos]:[text] } <table1>[coaches] { <col0>[coachID]:[text] <col1>[year]:[integer] <col2>[tmID]:[text] <col3>[lgID]:[text] <col4>[stint]:[integer] <col5>[won]:[integer] <col6>[lost...
SELECT COUNT( DISTINCT T2.playerID ) FROM `<table0>` AS T1 INNER JOIN players AS T2 ON T1.playerID = T2.playerID WHERE T1.award = 'Most Improved Player' AND T2.birthCountry = 'USA' AND T1.year BETWEEN 1985 AND 1990
Among the Most improved Players awarded from 1985-1990, how many player whose country is USA?
<table0>[Student_Tests_Taken] { <col0>[registration_id]:[INTEGER] <col1>[date_test_taken]:[DATETIME] <col2>[test_result]:[VARCHAR] } <table1>[Courses] { <col0>[course_id]:[INTEGER] <col1>[author_id]:[INTEGER] <col2>[subject_id]:[INTEGER] <col3>[course_name]:[VARCHAR] <col4>[120]:[course_description] <col5>[VARCHAR]:[2...
SELECT date_of_latest_logon, COUNT( `<col2>` ) FROM `<table3>` WHERE `<col7>` = "Jaskolski" OR `<col7>` = "Langosh" ORDER BY COUNT( `<col2>` ) DESC
What are the number of the dates of the latest logon of the students with family name 'Jaskolski' or 'Langosh'?, and show in descending by the Y.
<table0>[Neighborhoods] { <col0>[NeighborhoodID]:[INT] <col1>[NeighborhoodName]:[VARCHAR] <col2>[255]:[City] <col3>[VARCHAR]:[255] } <table1>[PropertyTaxRates] { <col0>[PropertyTaxRateID]:[INT] <col1>[NeighborhoodID]:[INT] <col2>[Rate]:[DECIMAL] }
SELECT N.NeighborhoodName, AVG( PTR.Rate ) as AvgRate FROM `<table0>` N JOIN PropertyTaxRates PTR ON N.NeighborhoodID = PTR.NeighborhoodID GROUP BY N.NeighborhoodName;
What is the average property tax rate for each neighborhood in the city?
<table0>[table_name_4] { <col0>[opponent]:[VARCHAR] <col1>[stadium]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "balboa stadium"
What opponent has balboa stadium as the opponent?
<table0>[table_name_32] { <col0>[date]:[VARCHAR] <col1>[set_2]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "13–25"
What is the Date when the Set 2 is 13–25?
<table0>[table_name_3] { <col0>[country]:[VARCHAR] <col1>[player]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "tiger woods"
What is the country for the player Tiger Woods?
<table0>[table_51248] { <col0>[Team]:[text] <col1>[Games]:[Played] <col2>[real]:[Wins] <col3>[real]:[Losses] <col4>[real]:[Ties] <col5>[real]:[Goals] <col6>[real]:[Goals] }
SELECT MAX( "Ties" ) FROM `<table0>` WHERE "Losses" < '4' AND "Goals Against" < '20'
Which team has the most ties with fewer than 4 losses and GA smaller than 20?
<table0>[table_20358] { <col0>[Game]:[real] <col1>[Date]:[text] <col2>[Team]:[text] <col3>[Score]:[text] <col4>[High]:[points] <col5>[text]:[High] <col6>[rebounds]:[text] <col7>[High]:[assists] <col8>[text]:[Location] <col9>[Attendance]:[text] <col10>[Record]:[text] }
SELECT COUNT( "High assists" ) FROM `<table0>` WHERE "Team" = 'New Jersey'
How many players had the most assists against New Jersey?
<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 `<table2>`.subject_id ) FROM `<table2>` INNER JOIN prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE `<table2>`.gender = "M" AND prescriptions.drug = "Xopenex Neb"
How many male patients were given the drug xopenex neb?
<table0>[table_train_135] { <col0>[int]:[loss_of_consciousness] <col1>[bool]:[systolic_blood_pressure_sbp] <col2>[int]:[head_injury] <col3>[bool]:[heart_disease] <col4>[bool]:[stroke] <col5>[bool]:[renal_disease] <col6>[bool]:[hepatic_disease] <col7>[bool]:[hydrocephalus] <col8>[bool]:[peptic_ulcer_disease] <col9>[bool...
SELECT * FROM `<table0>` WHERE allergy_to_drug = 1
patients with a history of severe drug allergy or hypersensitivity
<table0>[people] { <col0>[People_ID]:[VARCHAR] <col1>[Height]:[INTEGER] } <table1>[body_builder] { <col0>[Total]:[INTEGER] <col1>[People_ID]:[VARCHAR] }
SELECT AVG( T1.Total ) FROM `<table1>` AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Height > 200
What is the average total score of body builders with height bigger than 200?
<table0>[table_203_860] { <col0>[number]:[rank] <col1>[number]:[city] <col2>[text]:[population] <col3>[2011]:[number] <col4>[population]:[2001] <col5>[number]:[state] <col6>[territory]:[text] }
SELECT "city" FROM `<table0>` WHERE "population ( `<col3>` )" < 224000
who has a 2011 population less than 224,000 ?
<table0>[broadband_revenue] { <col0>[revenue_id]:[INT] <col1>[revenue_date]:[DATE] <col2>[revenue_amount]:[FLOAT] }
SELECT DATE_TRUNC( 'month', `<col1>` ) AS month, SUM( `<col2>` ) AS total_revenue FROM `<table0>` WHERE `<col1>` >= '2022-01-01' GROUP BY month;
Display the total revenue generated from broadband services for each month in the year 2022.
<table0>[table_40981] { <col0>[Rank]:[real] <col1>[text]:[Years] <col2>[text]:[Matches] <col3>[real]:[Goals] }
SELECT AVG( "Rank" ) FROM `<table0>` WHERE "Name" = 'viktors dobrecovs' AND "Matches" < '325'
What is the Rank for Viktors Dobrecovs with less than 325 Matches?
<table0>[table_name_39] { <col0>[date]:[VARCHAR] <col1>[city]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "warsaw"
What is the Date, when the City is Warsaw?
<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 COUNT( * ) > 0 FROM `<table2>` WHERE `<table2>`.uniquepid = '009-11235' AND STRFTIME( '%y', `<table2>`.hospitaladmittime ) <= '2104'
has patient 009-11235 actually visited the hospital until 2104?
<table0>[Dorm] { <col0>[dormid]:[INTEGER] <col1>[dorm_name]:[VARCHAR] <col2>[student_capacity]:[INTEGER] <col3>[gender]:[VARCHAR] } <table1>[Lives_in] { <col0>[stuid]:[INTEGER] <col1>[dormid]:[INTEGER] <col2>[room_number]:[INTEGER] } <table2>[Student] { <col0>[StuID]:[INTEGER] <col1>[LName]:[VARCHAR] <col2>[Fname]:[V...
SELECT city_code, AVG( `<col3>` ) FROM `<table2>` GROUP BY `<col7>` ORDER BY AVG( `<col3>` )
Bar chart of mean age from each city code, I want to list by the total number in ascending.
<table0>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[SuggestedEdits] { <col0>[number]:[PostId] <col1>[number]:[CreationDate] <col2>[time]:[ApprovalDate] <col3>[time]:[RejectionDate] <col4>[time]:[OwnerUserId] <col5>[number]:[Comment] <col6>[text]:[Text] <col7>[text]:[Title] <col8>[t...
SELECT WeekOf, SUM( Answered14Days ) / CAST( COUNT( * ) AS DECIMAL ) AS "RateAnsweredIn14Days" FROM ( SELECT DATEADD( day, 1 - DATEPART( weekday, CreationDate ), CreationDate ) AS "WeekOf", CAST( CASE WHEN EXISTS( SELECT * FROM `<table22>` AS a WHERE a.ParentId = q.Id AND DATEDIFF( second, q.CreationDate, CreationDate ...
Question Answer Rates (1 Day/7 Days/14 Days/Total) per Month. Autocleanup causes the dip 1 year ago - so don't be too hasty about conclusions. There are additional cleanups after 7 and 28 days apparently, although with a lesser effect. The end time is hard-coded to 14 days ago of the current date; this is because ...
<table0>[demographic] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[name]:[text] <col3>[marital_status]:[text] <col4>[age]:[text] <col5>[dob]:[text] <col6>[gender]:[text] <col7>[language]:[text] <col8>[religion]:[text] <col9>[admission_type]:[text] <col10>[days_stay]:[text] <col11>[insurance]:[text] <col12>...
SELECT COUNT( DISTINCT `<table0>`.subject_id ) FROM `<table0>` INNER JOIN diagnoses ON `<table0>`.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON `<table0>`.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Rheumatic heart disease, unspecified" AND prescriptions.route = "IV DRIP"
To how many patients with unspecified rheumatic heart disease was iv drip administered?
<table0>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModer...
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation FROM `<table18>` WHERE LOWER( Location ) LIKE '%kochi%' AND ( LOWER( AboutMe ) LIKE '%android%' ) ORDER BY Reputation DESC LIMIT 50
Top 50 Mobile Developers from Gujarat.
<table0>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table1>[gsi] { <col0>[course_offering_id]:[int] <col1>[student_id]:[int] } <table2>[semester] { <col0>[semester_id]:[int] } <table3>[instructor] { <col0>[instructor_id]:[int] <col1>[name]:[varchar] <col2>[uniqname]:[varchar] } <table4>[cou...
SELECT DISTINCT `<table3>`.name FROM `<table3>` INNER JOIN offering_`<table3>` ON offering_`<table3>`.`<table3>`_id = `<table3>`.`<table3>`_id INNER JOIN course_offering ON offering_`<table3>`.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
Who is , was , or will be teaching Information Industry ?
<table0>[employees] { <col0>[employee_id]:[VARCHAR] <col1>[department_id]:[VARCHAR] } <table1>[countries] { <col0>[country_name]:[VARCHAR] <col1>[country_id]:[VARCHAR] } <table2>[locations] { <col0>[location_id]:[VARCHAR] <col1>[country_id]:[VARCHAR] } <table3>[departments] { <col0>[department_id]:[VARCHAR] <col1>[l...
SELECT T1.employee_id, T4.country_name FROM `<table0>` AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id
Find employee with ID and name of the country presently where (s)he is working.
<table0>[table_name_43] { <col0>[position]:[INTEGER] <col1>[played]:[VARCHAR] <col2>[lost]:[VARCHAR] <col3>[difference]:[VARCHAR] }
SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col2>` < 3 AND `<col3>` = "1" AND `<col1>` > 7
What was the lowest Position for a Team with fewer than 3 Lost, a Difference of 1, and more than 7 games Played?
<table0>[Participates_in] { <col0>[stuid]:[INTEGER] <col1>[actid]:[INTEGER] } <table1>[Activity] { <col0>[actid]:[INTEGER] <col1>[activity_name]:[varchar] } <table2>[Faculty_Participates_in] { <col0>[FacID]:[INTEGER] <col1>[actid]:[INTEGER] } <table3>[Faculty] { <col0>[FacID]:[INTEGER] <col1>[Lname]:[VARCHAR] <col2>...
SELECT activity_name, COUNT( * ) FROM `<table1>` AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid
Show all the activity names and the number of faculty involved in each activity. Show bar chart.
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[procedures] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[t...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.days_stay > "4" AND lab.itemid = "51347"
tell me the number of patients with lab test item id 51347 who were admitted for more than 4 days in hospital.
<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 `<table1>`.ethnicity FROM `<table1>` WHERE `<table1>`.subject_id = "2560"
specify ethnic origin of patient id 2560
<table0>[emergency_responses] { <col0>[INT]:[district_name] <col1>[VARCHAR]:[response_type] <col2>[VARCHAR]:[INSERT] }
SELECT district_name, response_type, COUNT( * ) AS count FROM `<table0>` GROUP BY district_name, response_type ORDER BY district_name, count DESC;
What is the most common type of emergency response in each district?
<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 `<table3>`.subject_id ) FROM `<table3>` INNER JOIN procedures ON `<table3>`.hadm_id = procedures.hadm_id WHERE `<table3>`.days_stay > "9" AND procedures.short_title = "Allo hem stem ct w/o pur"
what is the number of patients whose days of hospital stay is greater than 9 and procedure short title is allo hem stem ct w/o pur?
<table0>[table_43073] { <col0>[Tournament]:[text] <col1>[2007]:[text] <col2>[2008]:[text] <col3>[2009]:[text] <col4>[2010]:[text] <col5>[2011]:[text] <col6>[2012]:[text] }
SELECT "2007" FROM `<table0>` WHERE "2008" = 'grand slam tournaments'
What is the 2007 of the Grand Slam Tournaments in 2008?
<table0>[concerts] { <col0>[INT]:[country] <col1>[VARCHAR]:[255] <col2>[city]:[VARCHAR] <col3>[255]:[artist_name] <col4>[VARCHAR]:[255] <col5>[tier]:[VARCHAR] <col6>[255]:[price] <col7>[DECIMAL]:[num_tickets] <col8>[INT]:[CREATE] <col9>[VIEW]:[artist_cities] <col10>[SELECT]:[artist_name] <col11>[city]:[concerts] }
SELECT artist_name FROM artist_cities WHERE city IN ( 'New York', 'London' ) GROUP BY artist_name HAVING COUNT( DISTINCT city ) = 2;
Find the names of artists who have performed in both New York and London.
<table0>[solar_projects] { <col0>[INT]:[state] <col1>[VARCHAR]:[installed_capacity] <col2>[FLOAT]:[INSERT] }
SELECT MAX( installed_capacity ) FROM `<table0>` WHERE state = 'New York';
What is the maximum installed capacity of a single solar project in the state of New York?
<table0>[farm] { <col0>[INT]:[region] <col1>[VARCHAR]:[crop] <col2>[VARCHAR]:[yield] <col3>[INT]:[INSERT] }
SELECT AVG( yield ) FROM `<table0>` WHERE region = 'Indian villages' AND crop = 'millets';
What is the average yield of 'millets' in 'Indian villages'?
<table0>[table_61500] { <col0>[Tournament]:[text] <col1>[2001]:[text] <col2>[2002]:[text] <col3>[2003]:[text] <col4>[2004]:[text] <col5>[2005]:[text] <col6>[2006]:[text] <col7>[2007]:[text] <col8>[2008]:[text] <col9>[2009]:[text] <col10>[2010]:[text] <col11>[2011]:[text] <col12>[2012]:[text] <col13>[2013]:[text] }
SELECT "2007" FROM `<table0>` WHERE "2003" = 'a'
What's the 2007 result when 2003 is a?
<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, flight WHERE ( CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' ...
list the flights from DALLAS to SAN FRANCISCO on AA
<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>[lab] {...
SELECT COUNT( DISTINCT `<table4>`.subject_id ) FROM `<table4>` INNER JOIN prescriptions ON `<table4>`.hadm_id = prescriptions.hadm_id WHERE `<table4>`.gender = "M" AND prescriptions.formulary_drug_cd = "HEPA100SYR"
count the number of patients whose gender is m and drug code is hepa100syr?
<table0>[film_market_estimation] { <col0>[Estimation_ID]:[int] <col1>[Low_Estimate]:[real] <col2>[High_Estimate]:[real] <col3>[Film_ID]:[int] <col4>[Type]:[text] <col5>[Market_ID]:[int] <col6>[Year]:[int] } <table1>[market] { <col0>[Market_ID]:[int] <col1>[Country]:[text] <col2>[Number_cities]:[int] } <table2>[film] ...
SELECT Title, COUNT( `<col1>` ) FROM `<table2>` AS T1 JOIN `<table2>`_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type, `<col1>` ORDER BY `<col1>`
Use a stacked bar chart to show how many films for each title and each type The x-axis is title, rank x-axis from low to high order.
<table0>[Clients] { <col0>[Client_ID]:[INTEGER] <col1>[Address_ID]:[INTEGER] <col2>[Customer_Email_Address]:[VARCHAR] <col3>[255]:[Customer_Name] <col4>[VARCHAR]:[255] <col5>[Customer_Phone]:[VARCHAR] <col6>[255]:[Other_Details] <col7>[VARCHAR]:[255] } <table1>[Order_Items] { <col0>[Order_Item_ID]:[INTEGER] <col1>[Ord...
SELECT Order_Date, COUNT( Order_Date ) FROM `<table7>`
What is the order date of each booking, and count them by a bar chart
<table0>[table_name_99] { <col0>[year]:[VARCHAR] <col1>[finish]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "champions"
In what Year was the Finish Champions?
<table0>[table_name_47] { <col0>[season]:[VARCHAR] <col1>[position]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "14th"
What season had a 14th position?
<table0>[table_65717] { <col0>[Rank]:[real] <col1>[Rider]:[text] <col2>[Team]:[text] <col3>[Speed]:[text] <col4>[Time]:[text] }
SELECT "Team" FROM `<table0>` WHERE "Rank" > '4' AND "Speed" = '104.574mph'
What teams rank is higher than 4 with a speed of 104.574mph?
<table0>[articles] { <col0>[INT]:[title] <col1>[VARCHAR]:[100] <col2>[published_date]:[DATE] }
INSERT INTO articles ( title ) VALUES ( 'Artificial Intelligence in Journalism' );
Insert a new record into the 'articles' table with the title 'Artificial Intelligence in Journalism'
<table0>[table_24574438_1] { <col0>[sinhalese]:[VARCHAR] <col1>[indian_tamil]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 177
Name the total number of sinhalese for indian tamil being 177
<table0>[table_77704] { <col0>[Class]:[text] <col1>[text]:[Quantity] <col2>[real]:[Date] <col3>[text]:[LNER] <col4>[Class]:[text] }
SELECT "W.A." FROM `<table0>` WHERE "Quantity" = '10' AND "LNER Class" = 'n13'
What WA has a LNER Class of n13 and 10?
<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>[regions] { <col0>[REGION_ID]:[decimal] <col1>[REGION_NAME]:[varchar] } <table2>[employees] { <col0>[EMPLOYE...
SELECT JOB_ID, `<col9>` FROM `<table2>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table5>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col9>` DESC
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the job_id , could you list from high to low by the y axis?
<table0>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col1...
SELECT All_Road, `<col8>` FROM `<table0>`
Show me about the distribution of All_Road and All_Games_Percent in a bar chart.
<table0>[table_6644] { <col0>[Res]:[text] <col1>[Record]:[text] <col2>[Opponent]:[text] <col3>[Method]:[text] <col4>[Round]:[text] }
SELECT "Method" FROM `<table0>` WHERE "Round" = '1' AND "Record" = '10–2'
Round of 1, and a Record of 10 2 had what method?
<table0>[table_name_71] { <col0>[year_s__won]:[VARCHAR] <col1>[total]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 289
Which Year(s) won has a Total of 289?
<table0>[CloseAsOffTopicReasonTypes] { <col0>[number]:[IsUniversal] <col1>[boolean]:[InputTitle] <col2>[text]:[MarkdownInputGuidance] <col3>[text]:[MarkdownPostOwnerGuidance] <col4>[text]:[MarkdownPrivilegedUserGuidance] <col5>[text]:[MarkdownConcensusDescription] <col6>[text]:[CreationDate] <col7>[time]:[CreationModer...
SELECT r.UserId AS "user_link", COUNT( * ) AS "Count" FROM ( SELECT h.UserId FROM `<table12>` AS h WHERE h.`<table12>`TypeId IN ( 7, 8, 9 ) AND NOT h.UserId IS NULL GROUP BY h.UserId, h.RevisionGUID ) AS r GROUP BY r.UserId ORDER BY 'Count' DESC
Lists users in descending order of number of rollback edits they've done.. Lists users in descending order of number of rollback edits they've done.
<table0>[track] { <col0>[Track_ID]:[int] <col1>[text]:[Location] <col2>[text]:[Seating] <col3>[real]:[Year_Opened] } <table1>[race] { <col0>[Race_ID]:[int] <col1>[text]:[Class] <col2>[text]:[Date] <col3>[text]:[Track_ID] }
SELECT Class, COUNT( Class ) FROM `<table1>` GROUP BY Class ORDER BY Class
Show me how many in each class of all races using a bar chart, and show by the X-axis in ascending.
<table0>[table_name_34] { <col0>[round]:[INTEGER] <col1>[position]:[VARCHAR] <col2>[overall]:[VARCHAR] }
SELECT MIN( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "wide receiver" AND `<col2>` < 222
Which Round is the lowest one that has a Position of wide receiver, and an Overall smaller than 222?
<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 lab ON `<table1>`.hadm_id = lab.hadm_id WHERE `<table1>`.dob_year < "2071" AND lab.itemid = "50953"
give me the number of patients whose year of birth is less than 2071 and item id is 50953?
<table0>[table_8517] { <col0>[Player]:[text] <col1>[Nationality]:[text] <col2>[Position]:[text] <col3>[Years]:[Grizzlies] <col4>[text]:[School] <col5>[Club]:[Team] }
SELECT "School/Club Team" FROM `<table0>` WHERE "Nationality" = 'united states' AND "Years for Grizzlies" = '1995-1996'
What's the United States team that played for the Grizzlies in 1995-1996?
<table0>[table_25561560_3] { <col0>[yacht]:[VARCHAR] <col1>[skipper]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Andrew Saies"
What yacht did Andrew Saies sail on?
<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>[patients] { <col0>[row_id]:[number] <col...
SELECT `<table5>`.label FROM `<table5>` WHERE `<table5>`.itemid IN ( SELECT t3.itemid FROM ( SELECT t2.itemid, DENSE_RANK( ) OVER ( ORDER BY COUNT( * ) DESC ) AS c1 FROM ( SELECT admissions.subject_id, `<table0>`.charttime, admissions.hadm_id FROM `<table0>` JOIN admissions ON `<table0>`.hadm_id = admissions.hadm_id WH...
what are the four most commonly given lab tests last year for patients who were previously diagnosed with hx of kidney malignancy in the same hospital visit?
<table0>[climate_communication] { <col0>[organization]:[VARCHAR] <col1>[year]:[INT] <col2>[budget]:[FLOAT] }
SELECT AVG( `<col2>` ) FROM ( SELECT `<col2>` FROM `<table0>` WHERE `<col0>` IN ( 'UNFCCC', 'Greenpeace', 'WWF' ) AND `<col1>` = 2022 ) AS top_orgs;
What is the average climate communication budget for the top 3 spending organizations in 2022?
<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 `<table4>`.subject_id ) FROM `<table4>` INNER JOIN procedures ON `<table4>`.hadm_id = procedures.hadm_id WHERE `<table4>`.days_stay > "17" AND procedures.long_title = "Other cystoscopy"
give me the number of patients whose days of hospital stay is greater than 17 and procedure long title is other cystoscopy?
<table0>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table1>[departments] { <col0>[DEPARTMENT_ID]:[decimal] <col1>[DEPARTMENT_NAME]:[varchar] <col2>[MANAGER_ID]:[decimal] <col3>[LOCATION_ID]:[decimal] } <tab...
SELECT HIRE_DATE, SUM( `<col7>` ) FROM `<table3>` WHERE `<col7>` BETWEEN 8000 AND 12000 AND `<col8>` <> "null" OR `<col10>` <> 40 ORDER BY SUM( `<col7>` ) 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, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, sort total number of salary from high to low order please.
<table0>[table_14975415_1] { <col0>[director]:[VARCHAR] <col1>[english_title]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Diary for My Loves"
Who is the director for diary for my loves?
<table0>[table_32510] { <col0>[Year]:[real] <col1>[Game]:[text] <col2>[Team]:[text] <col3>[Runner]:[text] <col4>[Score]:[text] }
SELECT "Team" FROM `<table0>` WHERE "Game" = 'capital bowl iv'
What teams played in Capital Bowl IV?
<table0>[outputevents] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[charttime]:[time] <col5>[itemid]:[number] <col6>[value]:[number] } <table1>[d_labitems] { <col0>[row_id]:[number] <col1>[itemid]:[number] <col2>[label]:[text] } <table2>[patients] {...
SELECT ( SELECT SUM( `<table6>`.amount ) FROM `<table6>` WHERE `<table6>`.icustay_id IN ( SELECT `<table4>`.icustay_id FROM `<table4>` WHERE `<table4>`.hadm_id IN ( SELECT `<table15>`.hadm_id FROM `<table15>` WHERE `<table15>`.subject_id = 10431 ) ) AND STRFTIME( '%y-%m-%d', `<table6>`.charttime ) <= '2105-12-00' ) - (...
give me the difference between the total input of patient 10431 and the output of the patient until 12/00/2105.
<table0>[table_name_24] { <col0>[country]:[VARCHAR] <col1>[total]:[VARCHAR] <col2>[finish]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 291 AND `<col2>` = "4"
What country had a total less than 291 and a 4 Finish?
<table0>[ReviewTaskResultTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[PostsWithDeleted] { <col0>[number]:[PostTypeId] <col1>[number]:[AcceptedAnswerId] <col2>[number]:[ParentId] <col3>[number]:[CreationDate] <col4>[time]:[DeletionDate] <col5>[time]:[Score] <col6>[number]:[ViewCount] <col7>[numb...
SELECT * FROM `<table12>` WHERE PostTypeId = 3
Votos/Publicaciones y Votos/Vistas paratodos los sitios de Stack Exchange.
<table0>[table_21095] { <col0>[text]:[Latitude] <col1>[text]:[Longitude] <col2>[text]:[Diameter] <col3>[text]:[Year] <col4>[named]:[real] <col5>[origin]:[text] }
SELECT MAX( "Year named" ) FROM `<table0>` WHERE "Name" = 'Norterma Tholus'
What year was Norterma Tholus created?
<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>`.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug = "Potassium Chl 40 mEq / 1000 mL D5NS"
what is the total number of patients treated with potassium chl 40 meq / 1000 ml d5ns who belonged to american indian/alaska native origin
<table0>[posts] { <col0>[INT]:[user_id] <col1>[INT]:[post_date] <col2>[DATE]:[INSERT] }
SELECT user_id, AVG( COUNT( * ) ) AS avg_`<table0>`_per_day FROM `<table0>` GROUP BY user_id;
What is the average number of posts per day for each user?
<table0>[atlantic_species_by_region] { <col0>[INT]:[species_name] <col1>[VARCHAR]:[255] <col2>[population]:[INT] <col3>[habitat]:[VARCHAR] <col4>[255]:[region] <col5>[VARCHAR]:[255] <col6>[ocean]:[VARCHAR] <col7>[255]:[INSERT] }
SELECT region, SUM( `<col2>` ) AS total_population FROM `<table0>` WHERE `<col6>` = 'Atlantic' GROUP BY region ORDER BY total_population DESC;
What is the total population size of marine species in each region of the Atlantic Ocean, ranked by population size?
<table0>[table_name_36] { <col0>[balls]:[VARCHAR] <col1>[strike_rate]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "70.10"
When the strike rate is 70.10, what is the balls?
<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>`.admission_type = "EMERGENCY" AND lab.itemid = "50809"
out of the total number of patients admitted to emergency, how many had item id 50809?
<table0>[labor_rights_advocacy] { <col0>[la_id]:[SERIAL] <col1>[PRIMARY]:[KEY] <col2>[union_id]:[VARCHAR] <col3>[issue]:[TEXT] <col4>[action]:[TEXT] <col5>[date]:[DATE] }
UPDATE labor_rights_advocacy SET issue = 'Equal Pay' WHERE union_id = '004';
Update the issue column in the labor_rights_advocacy table to 'Equal Pay' for all records with a union_id of 004
<table0>[table_55120] { <col0>[Episode]:[real] <col1>[Season]:[real] <col2>[Episode]:[text] <col3>[Airdate]:[text] <col4>[Location]:[text] }
SELECT MIN( "Episode #" ) FROM `<table0>` WHERE "Airdate" = 'october 31, 2001'
What is the lowest episode # with an air date of October 31, 2001?
<table0>[table_27469] { <col0>[June]:[text] <col1>[March]:[text] <col2>[January]:[text] <col3>[November]:[text] <col4>[August]:[text] }
SELECT COUNT( "August 21-22" ) FROM `<table0>` WHERE "March 27-29" = '139'
How many numbers are there for August when March is 139?
<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>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table2>[course_prerequ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest...
Which upper level electives are offered before noon ?
<table0>[code_description] { <col0>[code]:[varchar] <col1>[description]:[text] } <table1>[airport_service] { <col0>[city_code]:[varchar] <col1>[airport_code]:[varchar] <col2>[miles_distant]:[int] <col3>[direction]:[varchar] <col4>[minutes_distant]:[int] } <table2>[class_of_service] { <col0>[booking_class]:[varchar] <...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DTW' AND city.city_code = airport_service.city_code AND city.city_name = 'MILWAUKEE' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
get flights from MILWAUKEE to DTW
<table0>[table_name_1] { <col0>[score]:[VARCHAR] <col1>[team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "@ portland"
What is the Score with a Team that is @ portland?
<table0>[artworks] { <col0>[INT]:[title] <col1>[TEXT]:[year] <col2>[INT]:[artist_id] <col3>[INT]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE year BETWEEN 1901 AND 2000;
How many artworks were created in the 20th century?
<table0>[table_22580855_1] { <col0>[title]:[VARCHAR] <col1>[written_by]:[VARCHAR] <col2>[directed_by]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "Timothy J. Lea" AND `<col2>` = "Norberto Barba"
what is the name of the episode whose writer is Timothy J. Lea and the director is Norberto Barba?
<table0>[table_name_59] { <col0>[year]:[INTEGER] <col1>[entrant]:[VARCHAR] <col2>[points]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "elf team tyrrell" AND `<col2>` = "34"
What year did Elf Team Tyrrell have 34 points?
<table0>[mobile_providers] { <col0>[provider]:[TEXT] <col1>[subscribers]:[INT] }
CREATE VIEW top_providers AS SELECT provider, subscribers, ROW_NUMBER( ) OVER ( ORDER BY subscribers DESC ) as rank FROM mobile_providers;
Create a view to list top 3 mobile network providers by number of subscribers
<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 procedures ON `<table4>`.hadm_id = procedures.hadm_id WHERE `<table4>`.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "4523"
how many patients with procedure icd9 code 4523 were discharged to inpatient hospital?
<table0>[UnionMembers] { <col0>[MemberID]:[INT] <col1>[UnionID]:[INT] <col2>[Gender]:[VARCHAR] }
SELECT `<col1>` FROM `<table0>` GROUP BY `<col1>` HAVING SUM( CASE WHEN `<col2>` IN ( 'Female', 'Male' ) THEN 1 ELSE 0 END ) = 0;
Determine if there are any unions without any male or female members, showing only the union IDs
<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 1 * ( STRFTIME( '%j', CURRENT_TIME( ) ) - STRFTIME( '%j', `<table6>`.`<table6>`time ) ) FROM `<table6>` WHERE `<table6>`.`<table1>`unitstayid IN ( SELECT `<table1>`.`<table1>`unitstayid FROM `<table1>` WHERE `<table1>`.`<table1>`healthsystemstayid IN ( SELECT `<table1>`.`<table1>`healthsystemstayid FROM `<table1...
how many days has elapsed since patient 012-20116 was given a insulin - continuous infusion procedure for the first time on the current hospital encounter?
<table0>[intakeoutput] { <col0>[intakeoutputid]:[number] <col1>[patientunitstayid]:[number] <col2>[cellpath]:[text] <col3>[celllabel]:[text] <col4>[cellvaluenumeric]:[number] <col5>[intakeoutputtime]:[time] } <table1>[medication] { <col0>[medicationid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text...
SELECT COUNT( * ) > 0 FROM `<table1>` WHERE `<table1>`.`<table3>`unitstayid IN ( SELECT `<table3>`.`<table3>`unitstayid FROM `<table3>` WHERE `<table3>`.`<table3>`healthsystemstayid IN ( SELECT `<table3>`.`<table3>`healthsystemstayid FROM `<table3>` WHERE `<table3>`.uniquepid = '003-83' ) ) AND DATETIME( `<table1>`.dru...
is there any medication that has been prescribed to patient 003-83 in 02/this year?
<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 prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Send 500mg Vial"
what is the number of patients whose drug name is send 500mg vial?
<table0>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type]:[text] <col4>[drug]:[text] <col5>[formulary_drug_cd]:[text] <col6>[route]:[text] <col7>[drug_dose]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[te...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` INNER JOIN prescriptions ON `<table2>`.hadm_id = prescriptions.hadm_id WHERE `<table2>`.dod_year <= "2133.0" AND prescriptions.drug = "Clofarabine *IND*"
provide the number of patients whose year of death is less than or equal to 2133 and drug name is clofarabine *ind*?
<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 T2.Quantity FROM `<table5>` AS T1 INNER JOIN `Order Details` AS T2 ON T1.ProductID = T2.ProductID WHERE T2.OrderID = 10273 AND T1.ProductName = 'Ikura'
What is the quantity of Ikura ordered in order no. 10273?
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[patient] { <col0>[uniquepid]:[text] <col1>[patienthealthsystemstayid]:[number] <col2>[patientunitstayid]:[number] <col3>[gender]:[text] <col...
SELECT `<table1>`.hospitaladmittime FROM `<table1>` WHERE `<table1>`.uniquepid = '010-9767' AND STRFTIME( '%y', `<table1>`.hospitaladmittime ) = '2105' ORDER BY `<table1>`.hospitaladmittime DESC LIMIT 1
when is the last time patient 010-9767 visited the hospital in 2105?
<table0>[table_name_63] { <col0>[home_team]:[VARCHAR] <col1>[away_team]:[VARCHAR] }
SELECT `<col0>` AS score FROM `<table0>` WHERE `<col1>` = "melbourne"
What home team score has a Away team of melbourne?
<table0>[table_name_94] { <col0>[dist__miles]:[VARCHAR] <col1>[course]:[VARCHAR] <col2>[race_name]:[VARCHAR] <col3>[runners]:[VARCHAR] }
SELECT dist__miles_ FROM `<table0>` WHERE `<col2>` = "unnamed race" AND `<col3>` = "3" AND `<col1>` = "newcastle"
What is the distance for the unnamed race with 3 runners at Newcastle?
<table0>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Name]:[text] <col3>[ACC_Regular_Season]:[text] <col4>[ACC_Percent]:[text] <col5>[ACC_Home]:[text] <col6>[ACC_Road]:[text] <col7>[All_Games]:[text] <col8>[All_Games_Percent]:[int] <col9>[All_Home]:[text] <col10>[All_Road]:[text] <col1...
SELECT School_ID, `<col4>` FROM `<table0>` GROUP BY `<col7>`
Show school id vs acc_percent as scatter plot use a different color for each All_Games
<table0>[table_name_17] { <col0>[reg_gp]:[INTEGER] <col1>[player]:[VARCHAR] <col2>[rd__number]:[VARCHAR] }
SELECT SUM( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "morgan clark" AND `<col2>` < 7
What is the sum of the number of regular games played by Morgan Clark with the number of road games less than 7?
<table0>[PostHistoryTypes] { <col0>[number]:[text] } <table1>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table2>[ReviewRejectionReasons] { <col0>[number]:[text]...
WITH Raw AS ( SELECT OwnerUserId AS UserId FROM `<table8>` WHERE CreationDate > DATEADD( d, -60, CURRENT_TIMESTAMP( ) ) AND OwnerUserId > 0 UNION SELECT UserId FROM `<table13>` WHERE CreationDate > DATEADD( d, -60, CURRENT_TIMESTAMP( ) ) AND UserId > 0 ), Raw2 AS ( SELECT UserId FROM Raw GROUP BY UserId ), Raw3 AS ( SE...
Percentage of the total rep of users with 'monica' substring (only active in the last 2 months).
<table0>[accidents] { <col0>[INT]:[province] <col1>[VARCHAR]:[industry] <col2>[VARCHAR]:[num_] }
SELECT province, SUM( num_`<table0>` ) FROM `<table0>` WHERE industry = 'mining' GROUP BY province;
What is the total number of mining accidents in each province in Canada?