The document provides SQL queries to retrieve data from a 'people' table in a PostgreSQL database. The first query selects names from the table where the second letter is 'r'. The second query calculates the percentage of people in the table who have a deathdate recorded, aliases this result as 'percentage_dead', and correctly uses 100.0 instead of 100 in the calculation.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
35 views
Filtering Rows+aggregate Functions
The document provides SQL queries to retrieve data from a 'people' table in a PostgreSQL database. The first query selects names from the table where the second letter is 'r'. The second query calculates the percentage of people in the table who have a deathdate recorded, aliases this result as 'percentage_dead', and correctly uses 100.0 instead of 100 in the calculation.