schema
stringlengths
20
14.6k
query
stringlengths
17
2.58k
question
stringlengths
8
1.06k
<table0>[ClimateMitigationProjects] { <col0>[project_id]:[INT] <col1>[project_name]:[VARCHAR] <col2>[country]:[VARCHAR] <col3>[year]:[INT] } <table1>[CountrySIDS] { <col0>[country]:[VARCHAR] <col1>[sids]:[VARCHAR] }
SELECT sids, year, COUNT( * ) as num_projects FROM `<table0>` JOIN CountrySIDS ON `<table0>`.country = CountrySIDS.country GROUP BY sids, year;
Find the number of climate mitigation projects in Small Island Developing States (SIDS) for each year.
<table0>[course_prerequisite] { <col0>[pre_course_id]:[int] <col1>[course_id]:[int] } <table1>[program_requirement] { <col0>[program_id]:[int] <col1>[category]:[varchar] <col2>[min_credit]:[int] <col3>[additional_req]:[varchar] } <table2>[area] { <col0>[course_id]:[int] } <table3>[comment_instructor] { <col0>[instru...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MEDEDUC' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spr...
Which upper-level MEDEDUC classes can I take this Spring-Summer ?
<table0>[stadium] { <col0>[int]:[name] <col1>[text]:[Capacity] <col2>[int]:[City] <col3>[text]:[Country] <col4>[text]:[Opening_year] } <table1>[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]:[mete...
SELECT Nationality, SUM( ID ) FROM `<table1>` GROUP BY Nationality ORDER BY SUM( ID ) DESC
Return a bar chart about the distribution of Nationality and the sum of ID , and group by attribute Nationality, I want to sort from high to low by the y-axis.
<table0>[CommunityHealthWorkers] { <col0>[WorkerID]:[INT] <col1>[LGBTQ]:[VARCHAR] <col2>[CulturalCompetencyScore]:[INT] }
SELECT CulturalCompetencyScoreQuartile, COUNT( * ) as Count FROM ( SELECT CulturalCompetencyScore, NTILE( 4 ) OVER ( ORDER BY `<col2>` ) as CulturalCompetencyScoreQuartile, `<col1>` FROM `<table0>` ) as Data WHERE `<col1>` = 'Yes' GROUP BY CulturalCompetencyScoreQuartile;
Identify the number of community health workers who identify as LGBTQ+, by cultural competency score quartile.
<table0>[Maintenance_Contracts] { <col0>[maintenance_contract_id]:[INTEGER] <col1>[maintenance_contract_company_id]:[INTEGER] <col2>[contract_start_date]:[DATETIME] <col3>[contract_end_date]:[DATETIME] <col4>[other_contract_details]:[VARCHAR] } <table1>[Skills] { <col0>[skill_id]:[INTEGER] <col1>[skill_code]:[VARCHAR]...
SELECT staff_name, COUNT( * ) FROM `<table2>` AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY COUNT( * )
Return a bar chart on how many engineers did each staff contact? List both the contact staff name and number of engineers contacted, and could you order by the Y in asc please?
<table0>[users] { <col0>[INT]:[name] <col1>[TEXT]:[country] <col2>[TEXT]:[followers] <col3>[INT]:[INSERT] } <table1>[posts] { <col0>[INT]:[user_id] <col1>[INT]:[likes] <col2>[INT]:[timestamp] <col3>[DATETIME]:[INSERT] }
SELECT SUM( `<table0>`.followers ) FROM `<table0>` JOIN posts ON `<table0>`.id = posts.user_id WHERE `<table0>`.country = 'Japan' AND posts.likes > 50 AND posts.timestamp >= DATE_SUB( NOW( ), INTERVAL 1 MONTH );
What is the total number of followers for users from Japan, with more than 50 likes on their posts in the last month?
<table0>[Donors] { <col0>[DonorID]:[int] <col1>[DonorName]:[varchar] <col2>[Country]:[varchar] } <table1>[Donations] { <col0>[DonationID]:[int] <col1>[DonorID]:[int] <col2>[DonationAmount]:[decimal] }
SELECT SUM( `<table1>`.DonationAmount ) FROM `<table1>` INNER JOIN Donors ON `<table1>`.DonorID = Donors.DonorID WHERE Donors.Country IN ( 'Mexico', 'Brazil' );
What is the total amount donated by donors from Mexico and Brazil?
<table0>[table_name_95] { <col0>[to_par]:[VARCHAR] <col1>[country]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "denmark"
Name the To par for denmark
<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 Headquarter, SUM( `<col2>` ) FROM `<table0>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
For those records from the products and each product's manufacturer, find headquarter and the sum of price , and group by attribute headquarter, and visualize them by a bar chart.
<table0>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[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]...
SELECT FIRST_NAME, `<col10>` FROM `<table2>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table3>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col10>` DESC
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and department_id , and I want to list by the Y in descending.
<table0>[manager] { <col0>[Manager_ID]:[int] <col1>[text]:[Country] <col2>[text]:[Working_year_starts] <col3>[text]:[Age] <col4>[int]:[Level] } <table1>[railway] { <col0>[Railway_ID]:[int] <col1>[Railway]:[text] <col2>[Builder]:[text] <col3>[Built]:[text] <col4>[Wheels]:[text] <col5>[Location]:[text] <col6>[ObjectNumb...
SELECT Name, COUNT( Name ) FROM `<table3>` GROUP BY Name ORDER BY COUNT( Name ) DESC
Give me a bar chart for how many name of each name, and sort y-axis in desc order.
<table0>[retail_sales] { <col0>[sale_id]:[INT] <col1>[product_id]:[INT] <col2>[quantity]:[INT] <col3>[revenue]:[FLOAT] <col4>[is_ethically_sourced]:[BOOLEAN] <col5>[sale_date]:[DATE] }
SELECT SUM( `<col3>` ) as total_revenue, SUM( `<col2>` ) as total_quantity FROM `<table0>` WHERE `<col4>` = TRUE AND `<col5>` BETWEEN '2021-01-01' AND '2021-12-31';
Find the total revenue and quantity of ethically sourced products sold in 2021
<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 SUM( `<table3>`.dose_val_rx ) FROM `<table3>` WHERE `<table3>`.hadm_id IN ( SELECT `<table1>`.hadm_id FROM `<table1>` WHERE `<table1>`.subject_id = 29741 AND NOT `<table1>`.dischtime IS NULL ORDER BY `<table1>`.admittime LIMIT 1 ) AND `<table3>`.drug = 'tricor'
how many dose of tricor has been prescribed to patient 29741 in the first hospital encounter?
<table0>[table_59180] { <col0>[Team]:[text] <col1>[Agg]:[text] <col2>[Team]:[text] <col3>[1st]:[leg] <col4>[text]:[2nd] <col5>[leg]:[text] }
SELECT "2nd leg" FROM `<table0>` WHERE "Team 2" = 'dunaferr'
What is 2nd Leg, when Team 2 is 'Dunaferr'?
<table0>[Plants] { <col0>[INT]:[strain] <col1>[TEXT]:[growth_type] <col2>[TEXT]:[thc_percentage] <col3>[DECIMAL]:[INSERT] }
SELECT AVG( thc_percentage ) as avg_thc FROM `<table0>` WHERE growth_type = 'indoor' AND strain LIKE '%sativa%';
What is the average THC percentage for indoor-grown sativas?
<table0>[spacecrafts] { <col0>[spacecraft_id]:[INT] <col1>[name]:[VARCHAR] } <table1>[missions] { <col0>[mission_id]:[INT] <col1>[spacecraft_id]:[INT] <col2>[crew]:[VARCHAR] }
SELECT s.name FROM `<table0>` s INNER JOIN missions m ON s.spacecraft_id = m.spacecraft_id INNER JOIN ( SELECT crew FROM crew_members WHERE role = 'scientist' INTERSECT SELECT crew FROM crew_members WHERE role = 'engineer' ) cm ON m.crew = cm.crew;
Which spacecraft were used in missions that had both a scientist and an engineer as crew members?
<table0>[table_1507852_1] { <col0>[attribute]:[VARCHAR] <col1>[type]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "DOMNodeRemoved"
What are the attributes when the type is "DOMNodeRemoved"?
<table0>[ClaimsTable] { <col0>[PolicyID]:[INT] <col1>[PolicyType]:[VARCHAR] <col2>[ClaimAmount]:[DECIMAL] }
SELECT `<col1>` FROM `<table0>` WHERE `<col2>` IS NULL;
Identify policy types that do not have any claims.
<table0>[jobs] { <col0>[JOB_ID]:[varchar] <col1>[JOB_TITLE]:[varchar] <col2>[MIN_SALARY]:[decimal] <col3>[MAX_SALARY]:[decimal] } <table1>[employees] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[FIRST_NAME]:[varchar] <col2>[LAST_NAME]:[varchar] <col3>[EMAIL]:[varchar] <col4>[PHONE_NUMBER]:[varchar] <col5>[HIRE_DATE]:[date] ...
SELECT HIRE_DATE, `<col8>` FROM `<table1>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table6>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY `<col5>`
For those employees who do not work in departments with managers that have ids between 100 and 200, for commission_pct, hire_date, visualize the trend, sort X in asc order.
<table0>[table_30047613_12] { <col0>[date]:[VARCHAR] <col1>[streak]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "W 2"
in which date the strea was w 2
<table0>[table_name_54] { <col0>[award]:[VARCHAR] <col1>[category]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "teen pick show: comedy"
Which award show nominated The Suite Life on Deck for the Teen Pick Show: Comedy category?
<table0>[table_name_95] { <col0>[country]:[VARCHAR] <col1>[television_service]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "cartello promozionale sky hd"
What country has a television service with Cartello Promozionale sky hd?
<table0>[prescriptions] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[startdate]:[time] <col4>[enddate]:[time] <col5>[drug]:[text] <col6>[dose_val_rx]:[text] <col7>[dose_unit_rx]:[text] <col8>[route]:[text] } <table1>[diagnoses_icd] { <col0>[row_id]:[number] <col1>[subject_id]:[...
SELECT COUNT( DISTINCT t1.subject_id ) FROM ( SELECT admissions.subject_id, `<table1>`.charttime, admissions.hadm_id FROM `<table1>` JOIN admissions ON `<table1>`.hadm_id = admissions.hadm_id WHERE `<table1>`.icd9_code = ( SELECT `<table9>`.icd9_code FROM `<table9>` WHERE `<table9>`.short_title = 'acute necrosis of liv...
count the number of patients who were diagnosed with acute necrosis of liver in the same hospital visit after they were diagnosed with nb obsrv suspct infect during this year.
<table0>[countries] { <col0>[COUNTRY_ID]:[varchar] <col1>[COUNTRY_NAME]:[varchar] <col2>[REGION_ID]:[decimal] } <table1>[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]:[va...
SELECT HIRE_DATE, `<col8>` FROM `<table1>` 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, a line chart shows the change of commission_pct over hire_date, and show x-axis in desc order.
<table0>[Manufacturers] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Headquarter]:[VARCHAR] <col3>[255]:[Founder] <col4>[VARCHAR]:[255] <col5>[Revenue]:[REAL] } <table1>[Products] { <col0>[Code]:[INTEGER] <col1>[VARCHAR]:[255] <col2>[Price]:[DECIMAL] <col3>[Manufacturer]:[INTEGER] }
SELECT T1.Code, T1.Price FROM `<table1>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
For those records from the products and each product's manufacturer, visualize the relationship between code and price , and group by attribute name.
<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 lab ON `<table2>`.hadm_id = lab.hadm_id WHERE `<table2>`.insurance = "Self Pay" AND lab.label = "Vitamin B12"
Provide the number of self pay insurance patients who had vitamin b12 lab tests.
<table0>[tech_accessibility_patents] { <col0>[INT]:[year] <col1>[INT]:[community] <col2>[VARCHAR]:[255] <col3>[type]:[VARCHAR] <col4>[255]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE year = 2019 AND community = 'Women in Tech';
How many technology accessibility patents were granted to women in tech in 2019?
<table0>[EXISTS] { <col0>[grants]:[INT] <col1>[facultyid]:[INT] <col2>[department]:[VARCHAR] <col3>[INT]:[startdate] <col4>[DATE]:[enddate] }
SELECT SUM( amount ) FROM grants WHERE department='Mathematics' AND startdate >= DATE_SUB( CURRENT_DATE, INTERVAL 5 YEAR );
What is the total funding amount for grants awarded to faculty members in the Mathematics department in the past 5 years?
<table0>[Artists] { <col0>[ArtistID]:[INT] <col1>[VARCHAR]:[Age] <col2>[INT]:[Genre] <col3>[VARCHAR]:[INSERT] } <table1>[Festivals] { <col0>[FestivalID]:[INT] } <table2>[Performances] { <col0>[PerformanceID]:[INT] <col1>[ArtistID]:[INT] <col2>[FestivalID]:[INT] <col3>[INSERT]:[Festivals] <col4>[VALUES]:[Coachella] <c...
SELECT AVG( A.Age ) FROM `<table0>` A INNER JOIN Performances P ON A.ArtistID = P.ArtistID INNER JOIN Festivals F ON P.FestivalID = F.FestivalID WHERE A.Genre = 'Country';
What is the average age of all country musicians who have performed at music festivals?
<table0>[university] { <col0>[School_ID]:[int] <col1>[School]:[text] <col2>[Location]:[text] <col3>[Founded]:[real] <col4>[Affiliation]:[text] <col5>[Enrollment]:[real] <col6>[Nickname]:[text] <col7>[Primary_conference]:[text] } <table1>[basketball_match] { <col0>[Team_ID]:[int] <col1>[School_ID]:[int] <col2>[Team_Nam...
SELECT ACC_Road, AVG( `<col1>` ) FROM `<table1>` GROUP BY `<col6>` ORDER BY `<col6>` DESC
Give me the comparison about the average of School_ID over the ACC_Road , and group by attribute ACC_Road by a bar chart, order X-axis in descending order please.
<table0>[paperfield] { <col0>[fieldid]:[int] <col1>[paperid]:[int] } <table1>[paperkeyphrase] { <col0>[paperid]:[int] <col1>[keyphraseid]:[int] } <table2>[journal] { <col0>[journalid]:[int] <col1>[journalname]:[varchar] } <table3>[author] { <col0>[authorid]:[int] <col1>[authorname]:[varchar] } <table4>[field] { <co...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
papers about deep learning
<table0>[ticket_sales] { <col0>[sale_id]:[INT] <col1>[PRIMARY]:[KEY] <col2>[team_id]:[INT] <col3>[sale_date]:[DATE] <col4>[quantity]:[INT] }
INSERT INTO ticket_sales ( sale_id, team_id, sale_date, quantity ) VALUES ( 1, 101, '2022-02-15', 500 );
Insert data into ticket_sales table
<table0>[table_53742] { <col0>[Home]:[team] <col1>[text]:[Home] <col2>[team]:[score] <col3>[text]:[Away] <col4>[team]:[text] <col5>[Away]:[team] <col6>[score]:[text] <col7>[Venue]:[text] <col8>[Crowd]:[real] <col9>[Date]:[text] }
SELECT "Away team" FROM `<table0>` WHERE "Venue" = 'kardinia park'
Which away team played at Kardinia Park?
<table0>[lab] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[itemid]:[text] <col3>[charttime]:[text] <col4>[flag]:[text] <col5>[value_unit]:[text] <col6>[label]:[text] <col7>[fluid]:[text] } <table1>[diagnoses] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icd9_code]:[text] <col3>[short_title]:[...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` WHERE `<table2>`.discharge_location = "DEAD/EXPIRED" AND `<table2>`.days_stay > "1"
what is the number of patients whose discharge location is dead/expired and hospital stay is above 1 day?
<table0>[table_203_631] { <col0>[number]:[year] <col1>[number]:[name] <col2>[text]:[episodes] <col3>[text]:[guests] <col4>[text]:[winner] }
SELECT "episodes" FROM `<table0>` WHERE "name of show" = 'super trio series 2: movie buff championship'
how many episodes was charmaine sheh on in the variety show super trio 2 : movie buff champions
<table0>[AstronautMedicalData] { <col0>[astronaut_name]:[VARCHAR] <col1>[country]:[VARCHAR] <col2>[age]:[INT] <col3>[mission_name]:[VARCHAR] }
SELECT MIN( `<col2>` ) FROM `<table0>` WHERE `<col3>` = 'Mars Exploration';
What is the minimum age of astronauts who have traveled to Mars?
<table0>[table_204_741] { <col0>[number]:[rank] <col1>[number]:[name] <col2>[text]:[nationality] <col3>[text]:[text] <col4>[text]:[text] <col5>[text]:[notes] }
SELECT "name" FROM `<table0>` WHERE "rank" = ( SELECT "rank" FROM `<table0>` WHERE "name" = 'anna pau' ) - 1
who is the previous qualifier over anna pau ?
<table0>[candidate] { <col0>[Candidate_ID]:[int] <col1>[People_ID]:[int] <col2>[Poll_Source]:[text] <col3>[Date]:[text] <col4>[Support_rate]:[real] <col5>[Consider_rate]:[real] <col6>[Oppose_rate]:[real] <col7>[Unsure_rate]:[real] } <table1>[people] { <col0>[People_ID]:[int] <col1>[Sex]:[text] <col2>[text]:[Date_of_Bi...
SELECT Sex, COUNT( `<col1>` ) FROM `<table1>` GROUP BY `<col1>` ORDER BY COUNT( `<col1>` ) DESC
A bar chart shows the distribution of Sex and the amount of Sex , and group by attribute Sex, and sort Y-axis in descending order.
<table0>[Category_Revenue] { <col0>[sale_id]:[INT] <col1>[sale_date]:[DATE] <col2>[sale_amount]:[FLOAT] <col3>[brand_name]:[VARCHAR] <col4>[product_category]:[VARCHAR] }
SELECT `<table0>`.product_category, AVG( CASE WHEN `<table0>`.brand_name IN ( SELECT DISTINCT `<col3>` FROM Ethical_Fashion_Brands ) THEN 100 ELSE 0 END ) as ethical_brand_percentage FROM `<table0>` GROUP BY `<table0>`.product_category;
What is the percentage of revenue generated from ethical fashion brands in each product category?
<table0>[job_history] { <col0>[EMPLOYEE_ID]:[decimal] <col1>[START_DATE]:[date] <col2>[END_DATE]:[date] <col3>[JOB_ID]:[varchar] <col4>[DEPARTMENT_ID]:[decimal] } <table1>[locations] { <col0>[LOCATION_ID]:[decimal] <col1>[STREET_ADDRESS]:[varchar] <col2>[POSTAL_CODE]:[varchar] <col3>[CITY]:[varchar] <col4>[STATE_PROVI...
SELECT HIRE_DATE, SUM( `<col7>` ) FROM `<table5>` WHERE NOT `<col10>` IN ( SELECT `<col10>` FROM `<table6>` WHERE `<col9>` BETWEEN 100 AND 200 ) ORDER BY SUM( `<col7>` ) DESC
For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, sort total number in desc order.
<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 `<table6>`.`<table6>`time FROM `<table6>` WHERE `<table6>`.`<table8>`unitstayid IN ( SELECT `<table8>`.`<table8>`unitstayid FROM `<table8>` WHERE `<table8>`.`<table8>`healthsystemstayid IN ( SELECT `<table8>`.`<table8>`healthsystemstayid FROM `<table8>` WHERE `<table8>`.uniquepid = '002-61035' ) ) AND `<table6>`...
when was patient 002-61035 diagnosed with primary lung cancer - adenocarcinoma until 2104 for the last time?
<table0>[table_name_96] { <col0>[to_par]:[VARCHAR] <col1>[player]:[VARCHAR] <col2>[country]:[VARCHAR] <col3>[place]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = "united states" AND `<col3>` = "t4" AND `<col1>` = "arnold palmer"
What is To Par, when Country is 'United States', when Place is 'T4', and when Player is 'Arnold Palmer'?
<table0>[Employees] { <col0>[EmployeeID]:[INT] <col1>[VARCHAR]:[Gender] <col2>[VARCHAR]:[Department] <col3>[VARCHAR]:[Age] <col4>[INT]:[INSERT] }
SELECT ( COUNT( * ) FILTER ( WHERE Gender = 'Female' ) ) * 100.0 / COUNT( * ) FROM Employees;
What is the percentage of female employees in the mining company?
<table0>[table_name_23] { <col0>[drivers]:[VARCHAR] <col1>[laps]:[VARCHAR] <col2>[class]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 133 AND `<col2>` = "oc"
Who are the drivers with 133 laps in OC class?
<table0>[Feed] { <col0>[INT]:[PRIMARY] <col1>[KEY]:[FishStockID] <col2>[INT]:[FeedType] <col3>[VARCHAR]:[Quantity] <col4>[INT]:[FeedDate] <col5>[DATE]:[FOREIGN] <col6>[KEY]:[FishStockID] <col7>[REFERENCES]:[FishStock] }
SELECT f.SpeciesID, f.Name AS SpeciesName, SUM( fd.Quantity ) AS Total`<table0>`Quantity, SUM( h.Quantity ) AS TotalHarvestQuantity FROM `<table0>` fd JOIN Species f ON fd.SpeciesID = f.ID JOIN Harvest h ON f.ID = h.AquacultureFacilityID GROUP BY f.SpeciesID, f.Name;
What is the total quantity of feed and total harvest quantity for each species, grouped by species?
<table0>[cost] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[event_type]:[text] <col4>[event_id]:[number] <col5>[chargetime]:[time] } <table1>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:...
SELECT `<table14>`.charttime FROM `<table14>` WHERE `<table14>`.hadm_id IN ( SELECT `<table9>`.hadm_id FROM `<table9>` WHERE `<table9>`.subject_id = 13440 AND NOT `<table9>`.dischtime IS NULL ORDER BY `<table9>`.admittime DESC LIMIT 1 ) ORDER BY `<table14>`.charttime LIMIT 1
when did patient 13440 receive the first microbiology test on their last hospital visit?
<table0>[table_53605] { <col0>[Driver]:[text] <col1>[Constructor]:[text] <col2>[Laps]:[real] <col3>[Time]:[Retired] <col4>[text]:[Grid] }
SELECT "Constructor" FROM `<table0>` WHERE "Laps" = '16' AND "Grid" = '9'
What company was Constructor when there were 16 laps and grid was 9?
<table0>[diagnosis] { <col0>[diagnosisid]:[number] <col1>[patientunitstayid]:[number] <col2>[diagnosisname]:[text] <col3>[diagnosistime]:[time] <col4>[icd9code]:[text] } <table1>[microlab] { <col0>[microlabid]:[number] <col1>[patientunitstayid]:[number] <col2>[culturesite]:[text] <col3>[organism]:[text] <col4>[culture...
SELECT COUNT( * ) > 0 FROM `<table9>` WHERE `<table9>`.`<table3>`unitstayid IN ( SELECT `<table3>`.`<table3>`unitstayid FROM `<table3>` WHERE `<table3>`.`<table3>`healthsystemstayid IN ( SELECT `<table3>`.`<table3>`healthsystemstayid FROM `<table3>` WHERE `<table3>`.uniquepid = '015-94586' ) ) AND `<table9>`.`<table9>`...
has patient 015-94586 ever undergone a bronchodilator?
<table0>[creative_ai] { <col0>[artwork]:[TEXT] <col1>[style]:[TEXT] <col2>[artist]:[TEXT] <col3>[year]:[INT] }
INSERT INTO creative_ai ( artwork, style, artist, year ) VALUES ( 'Water Lilies', 'Impressionism', 'Monet', 1906 ), ( 'Composition VIII', 'Suprematism', 'Malevich', 1918 );
Insert new records into the 'creative_ai' table for 'Artwork' as 'Style'
<table0>[Player] { <col0>[pID]:[numeric] <col1>[pName]:[varchar] <col2>[yCard]:[varchar] } <table1>[College] { <col0>[cName]:[varchar] <col1>[state]:[varchar] <col2>[enr]:[numeric] } <table2>[Tryout] { <col0>[pID]:[numeric] <col1>[cName]:[varchar] <col2>[pPos]:[varchar] <col3>[decision]:[varchar] }
SELECT state, `<col2>` FROM `<table1>` AS T1 JOIN Tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes' ORDER BY `<col2>`
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision Plot them as bar chart, could you display Y in asc order?
<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 SUM( CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME( '%j', patient.hospitaldischargetime ) - STRFTIME( '%j', t2.`<table2>`time ) > 5 * 365 THEN 1 ELSE 0 END ) * 100 / COUNT( * ) FROM ( SELECT t1.uniquepid, t1.`<table2>`time FROM ( SELECT patient.uniquepid, `<table2>`.`<table2>`time FROM...
among patients diagnosed with hypomagnesemia, calculate the five year survival rate.
<table0>[table_name_80] { <col0>[from_club]:[VARCHAR] <col1>[player]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "robinho"
What is From Club, when Player is 'Robinho'?
<table0>[table_39564] { <col0>[Role]:[text] <col1>[Oyly]:[Carte] <col2>[1920]:[Tour] <col3>[text]:[Oyly] <col4>[Carte]:[1930] <col5>[Tour]:[text] <col6>[Oyly]:[Carte] <col7>[1939]:[Tour] <col8>[text]:[Oyly] <col9>[Carte]:[1945] <col10>[Tour]:[text] <col11>[Oyly]:[Carte] <col12>[1950]:[Tour] }
SELECT "D'Oyly `<col4>` 1945 Tour" FROM `<table0>` WHERE "D'Oyly `<col4>` `<col2>` Tour" = 'james turnbull'
D'Oyly Carte 1920 Tour of james turnbull is what D'Oyly Carte 1945 Tour?
<table0>[CLASS] { <col0>[crs_code]:[VARCHAR] } <table1>[course] { <col0>[crs_code]:[VARCHAR] }
SELECT COUNT( * ), dept_code FROM `<table0>` AS T1 JOIN course AS T2 ON T1.crs_code = T2.crs_code GROUP BY dept_code
Find the number of classes in each department.
<table0>[clinical_trials_data_2] { <col0>[drug_name]:[VARCHAR] <col1>[trial_outcome]:[VARCHAR] }
SELECT drug_name, `<col1>` FROM `<table0>` WHERE `<col0>` = 'DrugZ';
What are the clinical trial outcomes for drug 'DrugZ'?
<table0>[table_203_241] { <col0>[number]:[name] <col1>[text]:[founded] <col2>[number]:[defunct] <col3>[number]:[country] <col4>[text]:[publisher] <col5>[text]:[topics] <col6>[text]:[external] <col7>[link]:[text] }
SELECT ( SELECT COUNT( * ) FROM `<table0>` WHERE "founded" < 2000 ) > ( SELECT COUNT( * ) FROM `<table0>` AS `<table0>` WHERE "founded" > 2000 )
were more magazines founded before or after 2000 ?
<table0>[transfers] { <col0>[row_id]:[number] <col1>[subject_id]:[number] <col2>[hadm_id]:[number] <col3>[icustay_id]:[number] <col4>[eventtype]:[text] <col5>[careunit]:[text] <col6>[wardid]:[number] <col7>[intime]:[time] <col8>[outtime]:[time] } <table1>[admissions] { <col0>[row_id]:[number] <col1>[subject_id]:[numbe...
SELECT COUNT( DISTINCT t1.subject_id ) FROM ( SELECT admissions.subject_id, `<table11>`.charttime FROM `<table11>` JOIN admissions ON `<table11>`.hadm_id = admissions.hadm_id WHERE `<table11>`.icd9_code = ( SELECT `<table3>`.icd9_code FROM `<table3>` WHERE `<table3>`.short_title = 'chronic kidney dis nos' ) AND DATETIM...
how many patients during the last year received entral infus nutrit sub within 2 months after a diagnosis of chronic kidney dis nos?
<table0>[state] { <col0>[state_code]:[text] <col1>[state_name]:[text] <col2>[country_name]:[text] } <table1>[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...
SELECT DISTINCT flight.flight_id FROM `<table10>` AS AIRPORT_SERVICE_0, `<table10>` 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 = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 AND da...
give me the earliest flight on AA tomorrow from ST. PETERSBURG to MILWAUKEE
<table0>[table_6093] { <col0>[Model]:[Number] <col1>[text]:[Stepping] <col2>[text]:[Frequency] <col3>[text]:[Cache] <col4>[text]:[Multi] <col5>[text]:[Core] <col6>[text]:[Socket] <col7>[text]:[Release] <col8>[Date]:[text] <col9>[Number]:[text] }
SELECT "V Core" FROM `<table0>` WHERE "Stepping" = 'g1' AND "Frequency" = '1900mhz'
What is the v-core for a stepping of G1 and frequency of 1900MHz?
<table0>[safety_protocols] { <col0>[protocol_id]:[INT] <col1>[protocol_date]:[DATE] }
SELECT * FROM `<table0>` WHERE `<col1>` >= '2021-07-01' AND `<col1>` < '2021-10-01';
Identify safety protocol violations in Q3 2021.
<table0>[stadium] { <col0>[int]:[name] <col1>[text]:[Capacity] <col2>[int]:[City] <col3>[text]:[Country] <col4>[text]:[Opening_year] } <table1>[event] { <col0>[int]:[text] <col1>[Stadium_ID]:[int] <col2>[Year]:[text] } <table2>[record] { <col0>[int]:[Result] <col1>[text]:[Swimmer_ID] <col2>[int]:[Event_ID] } <table3...
SELECT meter_300, meter_100 FROM `<table3>` ORDER BY meter_300 DESC
Plot meter_100 by grouped by meter 300 as a bar graph, I want to order by the names in descending.
<table0>[course_prerequisite] { <col0>[pre_course_id]:[int] <col1>[course_id]:[int] } <table1>[student_record] { <col0>[student_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[grade]:[varchar] <col4>[varchar]:[transfer_source] <col5>[varchar]:[earn_credit] <col6>[varchar]:[repeat_term] <col7>[varchar]:...
SELECT COUNT( * ) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND co...
Is it possible to take 382 on Mondays and Wednesdays ?
<table0>[table_11240028_1] { <col0>[last_appearance]:[VARCHAR] <col1>[portrayed_by]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "A. J. Buckley"
Which episode did actor A. J. Buckley last appear in?
<table0>[table_203_245] { <col0>[number]:[year] <col1>[number]:[competition] <col2>[text]:[venue] <col3>[text]:[position] <col4>[text]:[event] <col5>[text]:[notes] }
SELECT "position" FROM `<table0>` WHERE id = ( SELECT id FROM `<table0>` WHERE "competition" = 'olympic games' AND "year" = 1996 ) + 1
how did silva plce in the competition after the olympic games in 1996 ?
<table0>[table_201_19] { <col0>[number]:[rank] <col1>[number]:[title] <col2>[text]:[studio] <col3>[text]:[director] <col4>[text]:[actors] <col5>[text]:[gross] }
SELECT "title" FROM `<table0>` ORDER BY "gross" LIMIT 1
which is the least successful film ?
<table0>[table_28087] { <col0>[Episode]:[Number] <col1>[real]:[Episode] <col2>[text]:[Rating] <col3>[text]:[Share] <col4>[real]:[Rating] <col5>[Share]:[text] <col6>[Viewers]:[millions] <col7>[text]:[Rank] <col8>[Timeslot]:[real] <col9>[Rank]:[Night] }
SELECT MIN( "Episode Number" ) FROM `<table0>` WHERE "Rating/Share ( 18-49 )" = '1.1/3'
What is the lowest episode number that had a ratings/share (18-49) of 1.1/3?
<table0>[campus_job_id] { <col0>[int]:[student_id] <col1>[int]:[location] } <table1>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_number]:[int] <col4>[start_time]:[time] <col5>[end_time]:[time] <col6>[monday]:[varchar] <col7>[tuesday]:[varchar] <col8>[wedne...
SELECT DISTINCT department, name, `<col3>` FROM `<table2>` WHERE ( `<col7>` LIKE '%Film and Cinema Studies%' OR `<col1>` LIKE '%Film and Cinema Studies%' ) AND `<col4>` = 11
I need an Film and Cinema Studies class that gives 11 credits , which ones do ?
<table0>[table_name_51] { <col0>[win__percentage]:[VARCHAR] <col1>[number_of_bids]:[VARCHAR] <col2>[conference]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE _number_of_bids = 2 AND `<col2>` = "west coast"
When the conference is west coast and the number of bids are at 2, what's the percentage of games won?
<table0>[BuildingRetrofits] { <col0>[BuildingID]:[INT] <col1>[Country]:[VARCHAR] <col2>[255]:[PreRetrofitRating] <col3>[FLOAT]:[PostRetrofitRating] }
SELECT AVG( ( PostRetrofitRating-PreRetrofitRating )/PreRetrofitRating*100 ) FROM `<table0>` WHERE `<col1>` = 'United Kingdom';
What is the average energy efficiency improvement (in percentage) for buildings in the UK after retrofitting?
<table0>[space_missions] { <col0>[mission_id]:[INT] <col1>[name]:[VARCHAR] <col2>[100]:[launch_date] <col3>[DATE]:[launching_agency] <col4>[VARCHAR]:[INSERT] }
SELECT name, launch_date FROM `<table0>` WHERE launching_agency = 'ISA';
What are the names and launch dates of all space missions launched by ISA?
<table0>[policyholders] { <col0>[INT]:[name] <col1>[TEXT]:[state] <col2>[TEXT]:[INSERT] } <table1>[claims] { <col0>[INT]:[policyholder_id] <col1>[INT]:[claim_amount] <col2>[FLOAT]:[claim_date] <col3>[DATE]:[INSERT] }
DELETE FROM `<table1>` WHERE `<table1>`.id IN ( SELECT `<table1>`.id FROM `<table1>` JOIN policyholders ON `<table1>`.policyholder_id = policyholders.id WHERE policyholders.state = 'Texas' AND `<table1>`.claim_date < DATE_SUB( CURRENT_DATE, INTERVAL 1 YEAR ) );
Delete claims that have been processed more than 1 year ago for policyholders in Texas.
<table0>[suppliers] { <col0>[supplier_id]:[INT] <col1>[supplier_name]:[VARCHAR] <col2>[ethical_rating]:[INT] <col3>[community_representation]:[VARCHAR] }
INSERT INTO suppliers ( supplier_id, supplier_name, ethical_rating, community_representation ) VALUES ( 104, 'Supplier W', 9, 'Underrepresented' );
Insert a new supplier from an underrepresented community with a high ethical rating
<table0>[EnvironmentalImpact] { <col0>[Country]:[VARCHAR] <col1>[255]:[Year] <col2>[INT]:[MiningType] <col3>[VARCHAR]:[255] <col4>[Impact]:[INT] }
SELECT Context.Country, Context.Impact FROM `<table0>` as Context WHERE Context.Year = 2016 AND Context.MiningType = 'Oil';
What are the environmental impact assessments for oil mining in Brazil in 2016?
<table0>[table_name_30] { <col0>[year]:[VARCHAR] <col1>[competition]:[VARCHAR] }
SELECT COUNT( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "anugerah bintang popular berita harian 23"
What was the year that had Anugerah Bintang Popular Berita Harian 23 as competition?
<table0>[table_name_87] { <col0>[final_position]:[VARCHAR] <col1>[ties]:[VARCHAR] <col2>[wins]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "0" AND `<col2>` = "5"
What is the final position with ties of 0, and wins of 5?
<table0>[table_24852622_1] { <col0>[circuit]:[VARCHAR] <col1>[round]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2"
What was the circuit in round 2?
<table0>[MilitaryEquipmentSales] { <col0>[seller]:[VARCHAR] <col1>[255]:[buyer] <col2>[VARCHAR]:[255] <col3>[equipment_model]:[VARCHAR] <col4>[255]:[sale_price] <col5>[DECIMAL]:[sale_date] <col6>[DATE]:[region] <col7>[VARCHAR]:[255] }
SELECT MAX( sale_price ) FROM `<table0>` WHERE `<col0>` = 'Epsilon Corp' AND region = 'North America' AND YEAR( sale_date ) = 2020;
What is the maximum sale price of military equipment sold by 'Epsilon Corp' in 'North America' in the year 2020?
<table0>[space_debris] { <col0>[debris_id]:[INT] <col1>[name]:[VARCHAR] <col2>[255]:[country] <col3>[VARCHAR]:[255] <col4>[debris_type]:[VARCHAR] }
SELECT country, COUNT( * ) as total_debris FROM `<table0>` GROUP BY country;
What is the distribution of space debris by country?
<table0>[table_name_29] { <col0>[opponent]:[VARCHAR] <col1>[week]:[VARCHAR] <col2>[date]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` < 12 AND `<col2>` = "november 25, 1965"
What opponent has a week less than 12, with November 25, 1965 as the date?
<table0>[table_name_36] { <col0>[pick]:[INTEGER] <col1>[overall]:[VARCHAR] <col2>[round]:[VARCHAR] }
SELECT AVG( `<col0>` ) FROM `<table0>` WHERE `<col1>` = 85 AND `<col2>` < 3
What is the average pick with 85 overall in a round lower than 3?
<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>[prescriptions] { <col0>[subject_id]:[text] <col1>[hadm_id]:[text] <col2>[icustay_id]:[text] <col3>[drug_type...
SELECT COUNT( DISTINCT `<table2>`.subject_id ) FROM `<table2>` WHERE `<table2>`.ethnicity = "BLACK/HAITIAN" AND `<table2>`.age < "85"
provide the number of patients whose ethnicity is black/haitian and age is less than 85?
<table0>[allergy] { <col0>[allergyid]:[number] <col1>[patientunitstayid]:[number] <col2>[drugname]:[text] <col3>[allergyname]:[text] <col4>[allergytime]:[time] } <table1>[vitalperiodic] { <col0>[vitalperiodicid]:[number] <col1>[patientunitstayid]:[number] <col2>[temperature]:[number] <col3>[sao2]:[number] <col4>[heart...
SELECT `<table7>`.admissionheight FROM `<table7>` WHERE `<table7>`.`<table7>`healthsystemstayid IN ( SELECT `<table7>`.`<table7>`healthsystemstayid FROM `<table7>` WHERE `<table7>`.uniquepid = '005-73237' ) AND NOT `<table7>`.admissionheight IS NULL AND DATETIME( `<table7>`.unitadmittime, 'start of month' ) = DATETIME(...
what was the last height of patient 005-73237 in the last month.
<table0>[residential_usage] { <col0>[user_id]:[INT] <col1>[region]:[VARCHAR] <col2>[usage]:[FLOAT] <col3>[timestamp]:[TIMESTAMP] }
SELECT AVG( `<col2>` ) FROM `<table0>` WHERE `<col1>` = 'Los Angeles' AND `<col3>` BETWEEN DATE_SUB( CURRENT_TIMESTAMP, INTERVAL 1 YEAR ) AND CURRENT_TIMESTAMP;
What is the average monthly water usage for residential users in the Los Angeles region for the past year?
<table0>[Affiliated_With] { <col0>[Physician]:[INTEGER] <col1>[Department]:[INTEGER] <col2>[PrimaryAffiliation]:[BOOLEAN] } <table1>[Undergoes] { <col0>[Patient]:[INTEGER] <col1>[Procedures]:[INTEGER] <col2>[Stay]:[INTEGER] } <table2>[Prescribes] { <col0>[Physician]:[INTEGER] <col1>[Patient]:[INTEGER] <col2>[Medicati...
SELECT T1.Name, COUNT( T1.Name ) FROM `<table9>` AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.`<table9>` JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name
Which physicians are trained in procedures that are more expensive than 5000, and count them by a pie chart
<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>[Has_amenity] { <col0>[dormid]:[INTEGER] <col1>[amenid]:[INTEGER] } <table3...
SELECT city_code, AVG( `<col3>` ) FROM `<table4>` GROUP BY `<col7>` ORDER BY AVG( `<col3>` )
What are average ages for students living in each city? Return a bar chart, and sort in asc by the total number.
<table0>[table_name_55] { <col0>[tyre]:[VARCHAR] <col1>[drivers]:[VARCHAR] <col2>[rounds]:[VARCHAR] <col3>[team]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col2>` = "all" AND `<col3>` = "nismo" AND `<col1>` = "satoshi motoyama"
What is the tyre of nismo team member satoshi motoyama when he has rounds of all?
<table0>[graduate_students] { <col0>[INT]:[name] <col1>[VARCHAR]:[department] <col2>[VARCHAR]:[email] <col3>[VARCHAR]:[INSERT] }
UPDATE graduate_students SET email = CONCAT( SUBSTRING_INDEX( email, '@', 1 ), '@physics.edu' ) WHERE department = 'Physics';
Update the email addresses of all graduate students in the Physics department with the domain 'physics.edu'.
<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 T2.Name, T2.Revenue FROM `<table0>` AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the sum of revenue , and group by attribute name, list from low to high by the x axis.
<table0>[expenditures] { <col0>[destination_country]:[VARCHAR] <col1>[visitor_country]:[VARCHAR] <col2>[avg_daily_expenditure]:[FLOAT] }
SELECT `<col2>` FROM `<table0>` WHERE `<col0>` = 'New Zealand' AND `<col1>` = 'Europe';
What is the average expenditure per day for tourists visiting New Zealand from Europe?
<table0>[CloseReasonTypes] { <col0>[number]:[text] <col1>[Description]:[text] } <table1>[Comments] { <col0>[number]:[PostId] <col1>[number]:[Score] <col2>[number]:[Text] <col3>[text]:[CreationDate] <col4>[time]:[UserDisplayName] <col5>[text]:[UserId] <col6>[number]:[ContentLicense] } <table2>[PostLinks] { <col0>[numb...
SELECT ROW_NUMBER( ) OVER ( ORDER BY Reputation DESC ) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM `<table21>` WHERE ( Location LIKE '%##Location##%' OR Location LIKE '%##AbbreviationRightSide##' ) AND NOT ( Location LIKE '%##Exclusion##%' OR Location LIKE '%##ExclusionRight...
Test: List of Users in a given location - Case Sensitive. List of Users in a given location. Case Sensitive
<table0>[SuggestedEditVotes] { <col0>[number]:[SuggestedEditId] <col1>[number]:[UserId] <col2>[number]:[VoteTypeId] <col3>[number]:[CreationDate] <col4>[time]:[TargetUserId] <col5>[number]:[TargetRepChange] } <table1>[TagSynonyms] { <col0>[number]:[SourceTagName] <col1>[text]:[TargetTagName] <col2>[text]:[CreationDate...
SELECT * FROM `<table24>` WHERE Location = 'Dominican Republic' ORDER BY Reputation DESC
Users from the Dominican Republic.
<table0>[threat_intelligence] { <col0>[metric_id]:[INT] <col1>[metric_date]:[DATE] <col2>[region]:[VARCHAR] <col3>[255]:[INSERT] }
SELECT COUNT( * ) FROM `<table0>` WHERE `<col2>` = 'Middle East' AND `<col1>` >= DATE_SUB( CURRENT_DATE, INTERVAL 1 YEAR );
Count the number of threat intelligence metrics reported in the Middle East in the last year.
<table0>[transactions] { <col0>[transaction_id]:[INT] <col1>[customer_id]:[INT] <col2>[transaction_amount]:[DECIMAL] <col3>[transaction_date]:[DATE] }
SELECT AVG( `<col2>` ) FROM `<table0>` WHERE `<table0>`.transaction_date BETWEEN '2022-01-01' AND '2022-03-31' GROUP BY DATE( `<col3>` );
What is the daily average transaction amount for all customers in Q1 2022?
<table0>[course_offering] { <col0>[offering_id]:[int] <col1>[course_id]:[int] <col2>[semester]:[int] <col3>[section_number]:[int] <col4>[start_time]:[time] <col5>[end_time]:[time] <col6>[monday]:[varchar] <col7>[tuesday]:[varchar] <col8>[wednesday]:[varchar] <col9>[thursday]:[varchar] <col10>[friday]:[varchar] <col11>[...
SELECT DISTINCT `<table8>`.department, `<table8>`.name, `<table8>`.number FROM `<table8>` INNER JOIN `<table8>`_offering ON `<table8>`.`<table8>`_id = `<table8>`_offering.`<table8>`_id INNER JOIN semester ON semester.semester_id = `<table8>`_offering.semester INNER JOIN program_`<table8>` ON program_`<table8>`.`<table8...
What classes are offered next Winter for PreMajor ?
<table0>[table_30120619_1] { <col0>[barony]:[VARCHAR] <col1>[area__acres]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE area__acres__ = 150
What is the barony of the townland whose area is 150 acres?
<table0>[table_69848] { <col0>[Club]:[text] <col1>[Sport]:[text] <col2>[League]:[text] <col3>[Venue]:[text] <col4>[Championships]:[Years] }
SELECT "Championships ( Years )" FROM `<table0>` WHERE "Club" = 'tampa bay storm'
Which years did the Tampa Bay Storm win the Championships?
<table0>[table_name_54] { <col0>[suburb]:[VARCHAR] <col1>[date_first_settled_as_a_suburb]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 1962
Which Suburb was First Settled as a Suburb in 1962?
<table0>[table_name_25] { <col0>[manufacturer]:[VARCHAR] <col1>[quantity_made]:[VARCHAR] <col2>[year_made]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = "2" AND `<col2>` = "1884"
What is Manufacturer, when Quantity Made is 2, and when Year Made is 1884?
<table0>[table_name_78] { <col0>[time]:[VARCHAR] <col1>[rank]:[VARCHAR] }
SELECT `<col0>` FROM `<table0>` WHERE `<col1>` = 3
What's the time of Rank 3?
<table0>[table_name_6] { <col0>[place]:[INTEGER] <col1>[artist]:[VARCHAR] <col2>[points]:[VARCHAR] }
SELECT MAX( `<col0>` ) FROM `<table0>` WHERE `<col1>` = "henri dès" AND `<col2>` < 8
What is the highest place of a song by Henri D s that has fewer than 8 points?