Find the total number of patients, male patients and female patients, shown as two columns (gender, total_quantity) and three rows: the count for each gender plus the count for all patients. The column names and values must match the expected output exactly.
Expected Output
Query Editor
User Output Ready
Execute a query or press Ctrl+Enter to view results...
Databases & Questions
Hint
PostgreSQL uses single quotes to enclose the String literals, date or constant, and double quotes to enclose column or table names... The approach to solving this problem is to separate each gender type is a group, and the grand total is one more group. PostgreSQL has a feature that computes several groupings at once.