Database: books
Question: Indicate the complete address of customers located in Lazaro Cardenas.
Evidence: complete address refers to street_number, street_name, city, country; "Lazaro Cardenas" is the city
SQL: SELECT street_number, street_name, city, country_id FROM address WHERE city = 'Lazaro Cardenas'

Database: movie_3
Question: What is the description of the film Artist Coldblooded?
Evidence: "ARTIST COLDBLOODED" is the title of film
SQL: SELECT description FROM film WHERE title = 'ARTIST COLDBLOODED'

Database: superstore
Question: Calculate the percentage of ordered office supplies products in the central and the south superstore.
Evidence: office supplies products refers to Category = 'Office Supplies'; central refers to Region = 'Central'; south superstore refers to Region = 'South'; percentage = divide(SUM(Product ID where Category = 'Office Supplies'), count(Product ID)) * 100 where Region = 'Central' OR Region = 'South'
SQL: SELECT CAST(SUM(CASE  WHEN T3.Category = 'Office Supplies' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T3.Category) FROM people AS T1 INNER JOIN central_superstore AS T2 ON T1.`Customer ID` = T2.`Customer ID` INNER JOIN product AS T3 ON T3.`Product ID` = T2.`Product ID`

Database: food_inspection
Question: What are the names of the establishments that met all the required standards for 4 consecutive years?
Evidence: establishment has the same meaning as business; score of 90 or more refers to score ≥ 90; year(date) = 2015; ; met all required standards for 4 consecutive years refers to COUNT(year(date)) = 4 where score = 100;
SQL: SELECT DISTINCT T4.name FROM ( SELECT T3.name, T3.years, row_number() OVER (PARTITION BY T3.name ORDER BY T3.years) AS rowNumber FROM ( SELECT DISTINCT name, STRFTIME('%Y', `date`) AS years FROM inspections AS T1 INNER JOIN businesses AS T2 ON T1.business_id = T2.business_id WHERE T1.score = 100 ) AS T3 ) AS T4 GROUP BY T4.name, date(T4.years || '-01-01', '-' || (T4.rowNumber - 1) || ' years') HAVING COUNT(T4.years) = 4

Database: synthea
Question: List 5 patients' name that need medication due to streptococcal sore throat disorder.
Evidence: patients name = first, last; streptococcal sore throat disorder refers to medications.REASONDESCRIPTION = 'Streptococcal sore throat (disorder)';
SQL: SELECT DISTINCT T2.first, T2.last FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T1.REASONDESCRIPTION = 'Streptococcal sore throat (disorder)' LIMIT 5

Database: olympics
Question: Which region do most of the athletes are from?
Evidence: region refers to region_name; most of the athletes refer to MAX(COUNT(person_id));
SQL: SELECT T2.region_name FROM person_region AS T1 INNER JOIN noc_region AS T2 ON T1.region_id = T2.id GROUP BY T2.region_name ORDER BY COUNT(T1.person_id) DESC LIMIT 1

Database: retail_world
Question: Make a list of all the territories in the Southern region.
Evidence: territories in the Southern region refer to TerritoryDescription WHERE RegionDescription = 'Southern';
SQL: SELECT DISTINCT T1.TerritoryDescription FROM Territories AS T1 INNER JOIN Region AS T2 ON T1.RegionID = T2.RegionID WHERE T2.RegionDescription = 'Southern'

Database: movielens
Question: How many of the movies rated 5 are rated by a user between the ages of 25 and 35?
SQL: SELECT COUNT(T1.movieid) FROM u2base AS T1 INNER JOIN users AS T2 ON T1.userid = T2.userid WHERE T1.rating = 5 AND T2.age BETWEEN 25 AND 35

Database: trains
Question: List all the load shapes of all head cars of each train and identify which load shape has the highest number. Calculate the percentage of the trains with the said head car that are running eas
Evidence: which load shape has the highest number refers to MAX(load_shape); head car refers to position = 1; east is a direction; calculation = MULTIPLY(DIVIDE(count(direction = 'east' where MAX(load_shape) where position = 1 then id), count(id)), 100)
SQL: SELECT DISTINCT T3.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC ) AS T3 UNION ALL SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 UNION ALL SELECT (CAST(COUNT(DISTINCT CASE WHEN T2.direction = 'east' THEN T2.id ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T2.id)) FROM cars AS T1 INNER JOIN trains AS T2 ON T1.train_id = T2.id WHERE T1.position = 1 AND T1.load_shape = ( SELECT T4.load_shape FROM ( SELECT load_shape, train_id FROM cars AS T WHERE position = 1 ORDER BY train_id DESC LIMIT 1 ) AS T4 )

Database: donor
Question: How many donations from teachers were done in the state of Colorado?
Evidence: from teachers refers to is_teacher_acct = 't'; the state of Colorado refers to donor_state = 'CO-Colorado'
SQL: SELECT COUNT(donationid) FROM donations WHERE is_teacher_acct = 't' AND donor_state = 'CO'

Database: student_loan
Question: State name of students who filed for bankruptcy and have the longest duration of absense from school.
Evidence: longest duration of absense refers to MAX(month)
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name ORDER BY T1.month DESC LIMIT 1

Database: legislator
Question: Based on the number of current legislators, calculate the percentage of legislators that served in 21st-Century.
Evidence: percentage = MULTIPLY(DIVIDE(SUM(strftime('%Y', start) between '2000' and '2017'), COUNT(bioguide_id)), 100.0); 1st-Century refers to strftime('%Y', T2.start) between '2000' and '2017';
SQL: SELECT CAST(SUM(CASE WHEN strftime('%Y', T2.start) BETWEEN '2000' AND '2017' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.bioguide_id) FROM current AS T1 INNER JOIN `current-terms` AS T2 ON T1.bioguide_id = T2.bioguide

Database: public_review_platform
Question: List the categories of all active businesses that were not in Arizona.
Evidence: active business refers to active = 'true'; not in Arizona refers to state ! = 'AZ'; category refers to category_name
SQL: SELECT T3.category_name FROM Business AS T1 INNER JOIN Business_Categories ON T1.business_id = Business_Categories.business_id INNER JOIN Categories AS T3 ON Business_Categories.category_id = T3.category_id WHERE T1.active LIKE 'TRUE' AND T1.state NOT LIKE 'AZ'

Database: olympics
Question: Where was the first Olympic game held?
Evidence: Where it was held refers to city_name; the first Olympic game refers to id where MIN(games_year);
SQL: SELECT T2.city_name FROM games_city AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.id INNER JOIN games AS T3 ON T1.games_id = T3.id ORDER BY T3.games_year LIMIT 1

Database: movie_platform
Question: When was the first movie released and who directed it?
Evidence: first movie refers to oldest movie_release_year;
SQL: SELECT movie_release_year, director_name FROM movies WHERE movie_release_year IS NOT NULL ORDER BY movie_release_year ASC LIMIT 1

Database: synthea
Question: Indicate the time frame and details of the most recent care plan suggested to Jacquelyn Shanahan.
Evidence: time frame = SUBTRACT(JULIANDAY(careplans.STOP), JULIANDAY(careplans.START)); details of care plan refers to careplans.DESCRIPTION; most recent care plan refers to MIN(careplans.STAR);
SQL: SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS timeFrame , T2.DESCRIPTION FROM patients AS T1 INNER JOIN careplans AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' ORDER BY T2.START DESC LIMIT 1